checkFrameset();

function checkFrameset(){
	if (top === self){
		if (get_getParam("skipFrameCheck") == "true"){
			return "";
		}
		var sPath = window.location.pathname;
		var query=this.location.search.substring(1);
		window.top.location.href = "/index.php?redirectPage="+sPath+"&"+query;
	}else{
		//in a frame
	}


	
/*	if (top.frames.length != 2){
		if (get_getParam("skipFrameCheck") == "true"){
			return "";
		}
		var sPath = window.location.pathname;
		var query=this.location.search.substring(1);
		window.top.location.href = "/index.php?redirectPage="+sPath+"&"+query;
	}
	*/
}

function get_getParam(name){
	var sParamName = name;
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.search );
  if( results == null )
    return "";
  else
    return results[1];
}

/*
 * example: embedFlash("intro.swf","myMovie",994,427,"#FFFFFF","7,0,0,0","movieId=myMovie","transparent","/myPath");
 */
function embedFlash(file,id,width,height,bgcolor,ieVersion,flashVars,wmode,base) {
	var embedString = "";
	var objectString = "";
	if(!bgcolor) bgcolor = "#FFFFFF";
	if(!ieVersion) ieVersion = "7,0,0,0";
	if(flashVars && flashVars != "") {
		embedString += 'FlashVars="'+flashVars+'" ';
		objectString += '<param name="FlashVars" value="'+flashVars+'" />';
	}
	if(wmode && wmode != "") {
		embedString += 'wmode="'+wmode+'" ';
		objectString += '<param name="wmode" value="'+wmode+'" />';
	}
	if(base && base != "") {
		embedString += 'base="'+base+'" ';
		objectString += '<param name="base" value="'+ base+'" />';
	}
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ieVersion+'" width="'+width+'" height="'+height+'" id="'+id+'">');
	document.write('<param name=movie value="'+file+'">');
	document.write('<param name=quality value="high">');
	document.write('<param name=bgcolor value="'+bgcolor+'">');
	document.write('<param name="swliveconnect" value="true">');
	document.write('<PARAM NAME="AllowScriptAccess" VALUE="always" />');
	document.write(objectString);
	document.write('<embed src="'+file+'" '+embedString+'quality="high" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" allowScriptAccess="always" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" swLiveConnect="true" id="'+id+'" name="'+id+'">');
	document.write('</embed></object>');
}

function toggle(obj) {
	var el = document.getElementById(obj);
	el.style.display = (el.style.display != 'none' ? 'none' : '' );
}
