// JavaScript Document

var global_url = "http://www.contact-packaging.co.uk/";
var global_title = "Contact Packaging";

var MM_contentVersion = 7;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
if ( MM_FlashCanPlay ) {

		
} else{
	document.location="getflash.htm";
}
//-->



function drawFlash(vars){
	
	//alert(vars)
	f_file = '<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="100%" height="100%" id="flash" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="flash.swf'+vars+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="flash.swf'+vars+'" loop="false" menu="false" quality="high" scale="noscale" wmode="transparent" bgcolor="#ffffff" width="100%" height="100%" name="flash" swLiveConnect=true align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
	return f_file;
}


function resizeFrame(){
	
	
	h = document.documentElement.clientHeight;
	w = document.documentElement.clientWidth;
	
	if(document.getElementById('main_div')){
		document.getElementById('main_div').style.height = h +"px";
	}
	

	
	
	
}

function openSurvey(survey){


window.open(survey,"","width=100,height,100,left=0,top=0,location=no,toolbar=no,resizable=no,scrollbars=yes");


}

function openEnlarged(image){

dWidth = 700;
dHeight = 465;



var imageopen = global_url+image;
var winwidth = screen.width;
var winheight = screen.height;
var leftpos = (winwidth - dWidth)/2;
var toppos = (winheight - dHeight)/2;


if(navigator.appVersion.indexOf("Win") != -1){
en = window.open("","","width="+dWidth+",height="+dHeight+", left="+leftpos+",top="+toppos+",scrollbars=no,toolbar=no,location=no");
en.document.write("<html><head><title>"+global_title+"</title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'></head><body bgcolor='#ffffff' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><img src='"+imageopen+"' width='"+dWidth+"' height='"+dHeight+"'></body></html>");
}else{

en = window.open(imageopen,"","width="+dWidth+",height="+dHeight+", left="+leftpos+",top="+toppos+",scrollbars=no,toolbar=no,location=no");
}

}



var maxH = 0;
var maxW = 0;
function setSize(){

	maxW = document.documentElement.clientWidth;
	maxH = document.documentElement.clientHeight

 	flash_file = drawFlash("?maxW="+maxW+"&maxH="+maxH+"&begin=1")
	
	document.getElementById('main_div').innerHTML = flash_file;

}

function setSize1(){


//window.location = "flash2.htm";


}
