/*
 * write embed tag for mac plugin
 * no use
 */
function writeMacPlugin(){
}

/*
 * write object tag for windows plugin
 * no use
 */
function writeIEPlugin(){
}

var winprint;
/*
 * display edit screen
 * flash version : templates, classcode no-user
 */
function showDialog(tempId, countryId, langId, pathName)
{
	var hei = 825;
	var wid = 1086;

	if(hei > screen.avilHeight){hei = screen.avilHeight;}
	if(wid > screen.avilWidth){wid = screen.avilWidth;}

	var uri = pathName;

	if(winprint == null || winprint.closed)
	{
		document.cookie="printcreationwindowisopen=yes";

		winprint = window.open(document.getElementById('win_plugin_url1').href + "?templateId=" + tempId + "&countryId=" + countryId + "&languageId=" + langId + "&uri=" + uri,
					"",
					"width="+wid+"px,height="+hei+"px,top=0,left=0,modal=yes,resizable=yes,scrollbars=yes,toolbar=no,directories=no,location=no");

	}
	else
	{
		alert("The window is opened!");
	}
}

/*
 * display edit screen
 * Open
 */
/*
 * display edit screen
 * Open
 */
function showOpenDialog()
{

	callWTLog();

	var hei = 825;
	var wid = 1086;

	if(hei > screen.avilHeight){hei = screen.avilHeight;}
	if(wid > screen.avilWidth){wid = screen.avilWidth;}

	var uri = location.pathname;
	var countryId = document.getElementById('cc_country').value;
	var langId = document.getElementById('cc_lang').value;

	if(winprint == null || winprint.closed)
	{
		document.cookie="printcreationwindowisopen=yes";

		winprint = window.open(document.getElementById('win_plugin_url1').href + "?templateId=Edit" + "&countryId=" + countryId + "&languageId=" + langId + "&uri=" + uri,
					"",
					"width="+wid+"px,height="+hei+"px,top=0,left=0,modal=yes,resizable=yes,scrollbars=yes,toolbar=no,directories=no,location=no");

	}
	else
	{
		alert("The window is opened!");
	}

}

function callWTLog(){
	var pathname = location.pathname;
	var pathData = pathname.split("/");
	var TARGET   = "HOME";
	var WTCOUNTYCD = pathData[3].toUpperCase();
	if(pathData[4] != "family"){
		TARGET   = "BIZ";
	}
	var TEMPCATE   = TARGET + "_" + pathData[5].toUpperCase();
	var DSCURI = pathname.replace("#|.htm","") + "/edit/index.htm";
	
	dcsMultiTrack(
				  "DCS.dcssip","www.brother.com",
				  "DCS.dcsuri",DSCURI,
				  "WT.ti","Creative Center Design",
				  "WT.cg_n","CCEDIT",
				  "WT.si_n","SIN_CCEDIT",
				  "WT.si_p","EDIT_TOP",
				  "DCSext.VISITOR","CC_VISITOR",
				  "DCSext.TARGET",TARGET,
				  "DCSext.TEMPCATE",TEMPCATE,
				  "DCSext.WTCOUNTYCD",WTCOUNTYCD
	              );
}


