var lastTypeIDsynced
function syncHeader(typeID, cImageUploaded, cStoreShortName, cStoreName){
	if (typeID != lastTypeIDsynced){
		if (typeID < 3){
			headerDIV.innerHTML = ""
			headerDIV.style.display = "none"
			mainHeader.style.display = ""
		}else{
			headerDIV.style.display = ""
			mainHeader.style.display = "none"

			s = ""
			s += "<table  height=45 style=\"table-layout:fixed; word-wrap:break-word;\" class=pageHead cellpadding=0 cellspacing=0 width=994 770>"
			s += "	<tr>"
			s += "		<td width=156 height=45>"
			s += "		<td height=45 valign=bottom width=50 style=\"padding-bottom:6px;\">"
			s += "			<a href=\"/main.asp\" target=pMain><img src=/images/polountaiRoot.png border=0></a></td>"
			s += "		<td height=45 valign=bottom width=324 style=\"overflow:hidden; padding-bottom:5px;\">"
			//s += "			<p style=\"margin-top:7;\"><nobr>"
			//s += "			&nbsp;<a href=\"/" + cStoreShortName + "\" style=\"font:15pt tahoma; color:ffffff;D9DFEE; text-decoration:none;\">"
			s += "			&nbsp;<a href=\"/main.asp?store=" + typeID + "\" target=pMain style=\"font:15pt tahoma; color:ffffff;D9DFEE; text-decoration:none;\">"
		if (cImageUploaded){
			s += "<img src=/images/stores/" + typeID + "S.jpg border=0 align=absmiddle style=\"vertical-align:middle; margin-bottom:.25em;\">"
		}
			s += "			" + cStoreName + "</a>"
			s += "</td>"
			s += "		<td align=right width=450 valign=top style=\"padding-top:12px\">"
			s += "		<table width=450 noheight=27 style=\"nposition:absolute; font: 7.5pt verdana;\" cellspacing=0 cellpadding=0>"
			s += "					<form action=/main.asp target=pMain method=get>"
			s += "					<tr><td align=right valign=bottom style=\"padding-bottom:2px; padding-right:5px;\"><img src=/images/searchLabel.png align=absmiddle>"
			s += "					<td valign=bottom><input value=\"\" type=text name=s style=\"font: 10pt verdana; nofont-weight:bold;width:200; height: 17;background-color:ffffff; color: 0000ff; border:0px\">"
			s += "						<font color=ffffff>in</font>"
			s += "						<select name=storeID style=\"font: 7.5pt verdana; width:130; background-color:ffffff;\">"
			s += "							<option value=\"" + typeID + "\">" + cStoreName
			s += "							<option value=\"\">All stores"
			//s += "						</select>&nbsp;<input type=image src=/images/newHeader/buttonSearchGo.gif align=absmiddle hspace=1 vspace=2></td></form>"
			s += "						</select></td><td height=17><input type=image src=/images/newHeader/buttonSearch.png noalign=absmiddle style=\"margin-left:2px\"></td></form>"
			s += "			</table>"
			s += "		</td>"
			s += "		<td valign=top style=\"padding-top:8px\">"
			s += "		<td valign=top width=8>"
			s += ""
			s += "		</td>"
			s += "	</tr>"
			s += "</table>"
			headerDIV.innerHTML = s
		}
		lastTypeIDsynced = typeID
	}
}



function printLoginBox(typeID, fURL){
	document.write("<table cellspacing=0 cellpadding=0>")
	document.write("<tr height=1><td>")

	document.write("<table cellspacing=0 cellpadding=0>")
	

	document.write("<tr height=21>")
	if (fURL == ""){
		document.write("<form method=POST action=/login.asp target=pLogin name=loginForm>")
	} else {
		document.write("<form method=POST action=/login.asp?type=" + typeID + "&fURL=" + fURL + " target=pLogin  name=loginForm>")
	}
	document.write("<td align=right><font class=plDescription>Username:</td>")
	document.write("<td width=3 background=/images/style/" + typeID + "/textBoxL.gif></td>")
	document.write("<td background=/images/style/" + typeID + "/textBoxC.gif>")
	document.write("	<input type=text class=login style=\"width:100\" nsize=20 name=T1></td>")
	document.write("<td width=3 background=/images/style/" + typeID + "/textBoxR.gif></td>")
	document.write("</tr>")
	

	document.write("<tr height=21>")
	document.write("<td align=right><font class=plDescription>Password:</td>")
	document.write("<td width=3 background=/images/style/" + typeID + "/textBoxL.gif></td>")
	document.write("<td background=/images/style/" + typeID + "/textBoxC.gif>")
	document.write("	<input type=password class=login style=\"width:100\" nsize=20 name=T2></td>")
	document.write("<td width=3 background=/images/style/" + typeID + "/textBoxR.gif></td>")
	document.write("</tr>")
	
	
	document.write("</table>")

	document.write("<tr><td><input type=checkbox name=fRememberPassword id=fRememberPassword style=\"height:15;width:14\" notchecked><label for=fRememberPassword class=plDescription style=\"cursor:hand;\">&nbsp;remember me</label>")
	document.write("<tr>")
	document.write("<td height=30 align=center valign=center>")
	document.write("	<input type=hidden name=fTypeID value=\"" + typeID + "\">")
	document.write("	<input type=image name=B1 src=/images/style/" + typeID + "/buttonLogin.gif>")
	document.write("</td></form>")
	document.write("</tr>")
	document.write("</table>")
}



function printMIStore(typeID, cImageUploaded, cStoreShortName, cStoreName, cActivated){
	t = "&nbsp;<a href=/" + cStoreShortName + " class=cmLink1><b>" + cStoreShortName + "</b></a>"
	
	t = "<table width=100%><tr><td height=1 bgcolor=D9DFEE></td></tr></table>"
	if (!cActivated){
	t += "<a class=headerMenuItem target=description href=/storeActivationRequest.asp?storeID=" + typeID + " onclick=\"closeMenu()\" style=\"color:ff0000;38b927; padding-top:1; padding-bottom:1; \"><b><img src=/images/iconExclamation.gif border=0 align=absmiddle height=16 width=16> Request Activation</b></a>"
	}
	
	t += "<a class=headerMenuItem target=pMain href=/storeEditItems.asp?storeID=" + typeID + " onclick=\"closeMenu()\" style=\"height:18;\" nostyle=\"padding-top:1; padding-bottom:1; \">"
	if (cImageUploaded){
		t += "			<img src=/images/stores/" + typeID + "S.jpg border=0 align=absmiddle>&nbsp;"
	}

	t += "<b>" + cStoreName + "</b></a>"
	t += "<a class=headerMenuItem target=description href=/storeItemAdd.asp?storeID=" + typeID + " onclick=\"closeMenu()\">&nbsp;Add New Item</a>"
	t += "<a class=headerMenuItem target=pMain href=/storeEditItems.asp?storeID=" + typeID + " onclick=\"closeMenu()\">&nbsp;Edit/Delete Items</a>"
	
	return t;
}




function printFlashBanner2(banner, url){
	document.write("<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" ")
	document.write(" WIDTH=120 HEIGHT=40 id=banner>")
	document.write("<PARAM NAME=movie VALUE=\"/advertisements/banners/banner.swf?b=" + banner + "&url=" + url + "\">")
	document.write("<PARAM NAME=wmode VALUE=OPAQUE><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF>")
	document.write("<EMBED src=\"/advertisements/banners/banner.swf?banner=" + banner + "&url=" + rl + "\" quality=high bgcolor=#FFFFFF WIDTH=120 HEIGHT=40 NAME=banner TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>")
	document.write("</OBJECT>")
}

function printFlashBanner(banner, url, cWidth, cHeight, interactive){
	if (interactive){
		//printFlash(banner, cWidth, cHeight, "banner", "OPAQUE", "");
		//printFlash("/advertisements/banners/banner" + cWidth + "x" + cHeight + "i.swf?b=" + banner + "&url=" + url, cWidth, cHeight, "banner", "OPAQUE", "");
		printFlash("/advertisements/banners/banner" + cWidth + "x" + cHeight + "i.swf", "b=" + banner + "&url=" + url, cWidth, cHeight, "banner", "OPAQUE", "");
	}else{
		//printFlash("/advertisements/banners/banner.swf?b=" + banner + "&url=" + url, cWidth, cHeight, "banner", "OPAQUE", "");
		printFlash("/advertisements/banners/banner.swf", "b=" + banner + "&url=" + url, cWidth, cHeight, "banner", "OPAQUE", "");
	}
}


function printFlash(path, flashVars, cWidth, cHeight, id, wmode, objectParameters){
	document.write(flashHTML(path, flashVars, cWidth, cHeight, id, wmode, objectParameters))
}
function printFlash2(path, cWidth, cHeight, id, wmode, objectParameters){
	document.write(flashHTML(path, cWidth, cHeight, id, wmode, objectParameters))
}


function flashHTML(path, flashVars, cWidth, cHeight, id, wmode, objectParameters){
//wmode = "OPAQUE"
//wmode = "transparent"
//alert(objectParameters)
	var s
	s = "<OBJECT " + objectParameters + " classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" "
	s += " WIDTH=" + cWidth + " HEIGHT=" + cHeight + " id=" + id + ">"
	s += "<PARAM NAME=movie VALUE=\"" + path + "\">"
	s += "<PARAM NAME=FlashVars VALUE=\"" + flashVars + "\">"
	s += "<PARAM NAME=quality VALUE=high><PARAM NAME=wmode VALUE=" + wmode + ">"
	s += "<EMBED " + objectParameters + " src=\"" + path + "\" FlashVars=\"" + flashVars + "\" quality=high bgcolor=#FFFFFF "
	s += "  WIDTH=" + cWidth + " HEIGHT=" + cHeight + " NAME=" + id + " id=" + id + " swLiveConnect=true  wmode=\"" + wmode + "\" type=\"application/x-shockwave-flash\"></EMBED>"
	s += "</OBJECT>"
	return s
}


