

var isWin = (navigator.platform == "Win32") || (navigator.platform == "Windows");
var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") || (navigator.platform == "Macintosh");
var sUserAgent = navigator.userAgent;
var isIE = sUserAgent.indexOf("compatible") != -1 && sUserAgent.indexOf("MSIE") != -1 && navigator.appName != "Opera"

function windowFullSize() {
	var screenW;
	var screenH;
	if (parseInt(navigator.appVersion)>3) {
		//screenW = screen.width;
		//screenH = screen.height;
		screenW = screen.availWidth;
		screenH = screen.availHeight;
	} else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion)==3 && navigator.javaEnabled()) {
		var jToolkit = java.awt.Toolkit.getDefaultToolkit();
		var jScreenSize = jToolkit.getScreenSize();
		screenW = jScreenSize.width;
		screenH = jScreenSize.height;
	} 
	self.moveTo(0,0);
	self.resizeTo(screenW, screenH);
}

var initProgram;
function getInitProgram(){ 
	var s = location.search;
	if(s.length > 1){
		var isIndex = s.indexOf("=");
		initProgram= s.substring(isIndex+1);
	}
}

 
function setHTMLHref(href) {
  document.location.search = href;
}  

function setHTMLTitle(title) { document.title = "Creative Services - "+title; }  

function imagePopUp(image,title,w,h){
  var newwin=window.open(image,'_blank','height='+h+',width='+w+',toolbar=no,resizable=no,location=no,directories=no,status=no,menubar=no,scrollbars=no')
  newwin.document.open();
  newwin.document.write('<html><head><title>'+title+'</title></head>');
  newwin.document.write('<body bgcolor="#0000000" style="margin-left:0; margin-right:0; margin-bottom:0; margin-top:0">');
  newwin.document.write('<img src="'+image+'" alt="Portfolio Image" style="margin-left:0; margin-right:0; margin-bottom:0; margin-top:0;vertical-align:middle;">');
  newwin.document.write('</body></html>');
  newwin.document.close();
}

function swfPopUp(swf,swfName,title,w,h){
  var newwin=window.open(swf,'_blank','height='+h+',width='+w+',toolbar=no,resizable=no,location=no,directories=no,status=no,menubar=no,scrollbars=no')
  newwin.document.open();
  newwin.document.write('<html><head><title>'+title+'</title></head>');
  newwin.document.write('<body bgcolor="#0000000" style="margin-left:0; margin-right:0; margin-bottom:0; margin-top:0">');
  newwin.document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+w+'" height="'+h+'" id="'+swfName+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="movie" value="'+swf+'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="'+swf+'" quality="high" bgcolor="#ffffff" width="'+w+'" height="'+h+'" name="'+swfName+'" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
  newwin.document.write('</body></html>');
  newwin.document.close();
}

function htmlPopUp(file, w, h){
  var newwin = window.open(file,'_blank','height='+h+',width='+w+',toolbar=no,resizable=no,location=no,directories=no,status=no,menubar=no,scrollbars=no')
}

function getScreensZip(file, w, h){
  if(isIE){
    window.open('downloadZip.html?file='+file,'_blank','height=100,width=200,toolbar=no,resizable=no,location=no,directories=no,status=no,menubar=no,scrollbars=no');
  }else{
    var newwin = window.open(file,'_blank','height='+h+',width='+w+',toolbar=no,resizable=no,location=no,directories=no,status=no,menubar=no,scrollbars=no'); 
  }
}

function downloadReel(){
  if(isIE){
    window.open("downloadReel.html",'_blank','height=100,width=200,toolbar=no,resizable=no,location=no,directories=no,status=no,menubar=no,scrollbars=no');
  }else{
     if(isWin){
       window.open("cs_reel_pc.zip");
     }else{
       window.open("cs_reel_mac.zip");
     }
  }
}


windowFullSize();
getInitProgram();