﻿// ------------------------------------
// a Pollen Production
// Pollen Co. Ltd.
// Mobile.Multimedia.Internet.Interior
// www.pollen.com.hk
// ------------------------------------

// ------------------------------------
function embedSWF(id,mov,w,h,bgc) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ');
	document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ');
	document.write('width="' + w + '" height="' + h + '" id="' + id + '" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="' + mov + '.swf" /><param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="' + bgc + '" />');
	document.write('<embed src="' + mov + '.swf" quality="high" bgcolor="' + bgc + '" width="' + w + '" height="' + h + '" name="' + id + '" ');
	document.write('align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}

function embedSWFVar(id,mov,v,w,h,bgc) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ');
	document.write('codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ');
	document.write('width="' + w + '" height="' + h + '" id="' + id + '" align="middle">');
	document.write('<param name="flashvars" value="' + v + '" />');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="' + mov + '.swf" /><param name="quality" value="best" />');
	document.write('<param name="bgcolor" value="' + bgc + '" />');
	document.write('<embed src="' + mov + '.swf" quality="best" bgcolor="' + bgc + '" width="' + w + '" height="' + h + '" name="' + id + '" ');
	document.write('flashvars="' + v + '" ');
	document.write('align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0

  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;

}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0

  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);

}


function MM_swapImgRestore() { //v3.0
  var i , x , a=document.MM_sr; 
  
  for(i=0; a && i<a.length && (x=a[i]) && x.oSrc; i++)
  	x.src = x.oSrc;
}

function MM_preloadImages() { //v3.0
	
	if(d.images) {
		if(!d.MM_p) d.MM_p=new Array();

		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
		
		for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0) {
				d.MM_p[j]=new Image;
				d.MM_p[j++].src=a[i];
			}
	}
}

function MM_findObj(n, d) { //v4.0
	var p,i,x; 
	
	 if(!d) d=document;
	
	if ((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}

	if (!(x=d[n])&&d.all) x=d.all[n];
	
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	
	for (i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	
	if (!x && document.getElementById) x=document.getElementById(n); 
	
	return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; 

  document.MM_sr=new Array; 
  
  for(i=0;i<(a.length-2);i+=3)
  	if ((x=MM_findObj(a[i]))!=null) { 
		document.MM_sr[j++]=x;
		if(!x.oSrc) x.oSrc=x.src;
		x.src=a[i+2];
	}
}

function openWin(sURL, sName, sFx) {
	nWin=window.open(sURL, sName, sFx); 
	nWin.focus();
}

function openFullScreen(page,name) {
      window.open(page,name,"fullscreen=1,width="+(screen.width-10)+",height="+(screen.height-50)+",top=0,left=0,right=0");
}

function closeWin() {  
	parent.close(); 
	close();
}

function toggle_all_off(e) {
  var x = 0;
  var i = 1;
  while (x = eval('document.all.t'+i)) {
    if (x && e != 't'+i) x.style.display = 'none';
    i++;
  }
}

function toggle(e)
{
  toggle_all_off(e);
  var x = eval('document.all.'+e);
   if (x.style.display == 'none') {
    x.style.display = 'block';
  } else {
    x.style.display = 'none';
  }
}

function menu (cat) {
	var tCat = document.getElementById(cat);
	if (tCat.className=="show") {
		tCat.className="hide";
	} else {
		tCat.className="show";
	}
}

function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

function ReadCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function InitCookie() {
  if ((lang = ReadCookie("lang")) == "") {
    document.cookie = 'lang=0';
    document.location.reload();
  }
}



InitCookie();






