//  ew_receivingWidth and ew_receivingHeight should be defined if need to set to a different size
document.writeln('<scr'+'ipt type="text/javascript" language="Javascript" src="../QA/reporting/extMouseWheel.js"></scr'+'ipt>');
if (typeof(ew_receivingWidth) == "undefined")
	var ew_receivingWidth = 750;
if (typeof(ew_receivingHeight) == "undefined")
	var ew_receivingHeight = 400;

function parseParam(name){
	try {
		var query=window.location.search;
		var pos=query.indexOf(name+"=");
		var pos2=0;
		if (pos!=-1){
			pos=pos+name.length+1;
			pos2=query.indexOf("&", pos);
			if (pos2!=-1){ return query.substring(pos, pos2); } else { return query.substring(pos); }
		} else { return null; }
	} catch(e){ return null; }
}

if (typeof(useNewReceivingSwf)=='undefined'){
	var useNewReceivingSwf=false;
	if (parseParam("usenew")!=null){
	var useNew=parseParam("usenew");
	if (useNew=="true") useNewReceivingSwf=true;
	}
}

var swfName="receiving.swf";
if (useNewReceivingSwf==true) swfName="QAReceiving.swf";

var qaPath="";
switch(document.domain)
{
	case "uat.apps.atlanta.eyewonder.com":
		qaPath="http://uat.apps.atlanta.eyewonder.com/adWdrVideoSpace/ad/";
		break;
	case "dev.apps.atlanta.eyewonder.com":
		qaPath="http://dev.apps.atlanta.eyewonder.com/adWdrVideoSpace/ad/";
		break;
	case "cdn1.eyewonder.com":
		qaPath="http://cdn1.eyewonder.com/200125/";
		break;
	case "cdn.eyewonder.com":
		qaPath="http://cdn.eyewonder.com/100125/";
		break;
	case "dev.cdn1.atlanta.eyewonder.com":
		qaPath="http://dev.cdn1.atlanta.eyewonder.com/200125/";
		break;
	case "uat.cdn1.atlanta.eyewonder.com":
		qaPath="http://uat.cdn1.atlanta.eyewonder.com/200125/";
		break;
	case "dev.cdn.atlanta.eyewonder.com":
		qaPath="http://dev.cdn.atlanta.eyewonder.com/100125/";
		break;
	case "uat.cdn.atlanta.eyewonder.com":
		qaPath="http://uat.cdn.atlanta.eyewonder.com/100125/";
		break;
	default:
		qaPath="http://apps.eyewonderlabs.com/adWdrVideoSpace/ad/";
}

if (typeof(ewCommon)=='undefined') var ewCommon=false;
var ewUrl = document.location.href.substring(0, document.location.href.indexOf("?"));

var ew_receivingFlashVars = 'qaReportUUID=common';
if (typeof(ew_qaReportUUID)!="undefined")
	ew_receivingFlashVars = 'qaReportUUID=' + ew_qaReportUUID;
ew_receivingFlashVars+="&serverurl=" + document.domain + '&qapath=' + ewUrl + '&common=' + String(ewCommon);

//x=prompt("Flashvars:", ew_receivingFlashVars);
if (typeof(webCodeVersion)!="undefined")
	ew_receivingFlashVars += '&webCodeVersion=' + webCodeVersion;

document.writeln('<object id="receiving" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="receiving" align="middle" width="'+ew_receivingWidth+'" height="'+ew_receivingHeight+'"><param name="allowScriptAccess" value="always"><param name="movie" value="'+qaPath+'QA/reporting/'+swfName+'?nocache=' + new Date().getTime()+ '"><param name="quality" value="high"><param name="bgcolor" value="#FFFFFF"><param name="base" value="'+qaPath+'QA/reporting/"><param name="wmode" value="opaque"><param name="FlashVars" value="'+ew_receivingFlashVars+'"><embed src="'+qaPath+'QA/reporting/'+swfName+'?nocache=' + new Date().getTime()+ '" base="'+qaPath+'QA/reporting/" wmode="opaque" quality="high" bgcolor="#FFFFFF" name="receiving" pluginspage="http://www.macromedia.com/go/getflashplayer" height="' + ew_receivingHeight + '" width="' + ew_receivingWidth + '" flashvars=' + ew_receivingFlashVars + '></object>');
