var window_width = 0, window_height = 0;
var movie_width = 0, movie_height = 0;
var  window_wide =false;
var  screen_wide =false;


if( typeof( window.innerWidth ) == 'number' ) {
                window_width = window.innerWidth; window_height = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth ||document.documentElement.clientHeight ) ) {
                window_width = document.documentElement.clientWidth; window_height = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                window_width = document.body.clientWidth; window_height = document.body.clientHeight;
}

//The window in which we are
if((window_height/window_width)<0.55){
   window_wide =true;
}
//the screen itself
if((screen.height/screen.width)<0.68){
   screen_wide =true;
}

var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
        browser = "Konqueror";
        OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
        browser = "Netscape Navigator"
        version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
        if (checkIt('linux')) OS = "Linux";
        else if (checkIt('x11')) OS = "Unix";
        else if (checkIt('mac')) OS = "Mac"
        else if (checkIt('win')) OS = "Windows"
        else OS = "an unknown operating system";
}

function checkIt(string)
{
        place = detect.indexOf(string) + 1;
        thestring = string;
        return place;
}

function bookmarkFunction(url){
var url = "http://www.clipclicmusic.com";
var description = "ClipClicMusic.com - Veronique and Jason BARNARD";
var alertText = "First push OK and then hit CTRL+D to add a bookmark to this site.";
  if (browser == "Internet Explorer") {
   if(OS=='Mac'){
    alert(alertText);
   }else{
    window.external.AddFavorite(url, description);
   }
  }else {
    alert(alertText);
  }
}

 var time = new Date();
 var random_var = (time.getTime());
 var window_ccm;
function open_window_ccm(){
         window_width_ccm = window_width;
         window_height_ccm = window_height;
          url_to_load  = "loadflash.php";
          window_ccm =  window.open(url_to_load, "window_ccm","width="+screen.width+",height="+screen.height+",toolbar=no,location=no,directories=no,status=no,menubar=no, scrollbars=no,resizable=yes,copyhistory=no,top=0,left=0");
          window_ccm.focus();
}
