function MM_preloadImages() { //v3.0
  var d=document; 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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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 MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function enlarge(imageName,alt,title) {
	newWindow = window.open('','newWindow', 'width=600, height=600, scrollbars=yes, resizable=yes,');
	newWindow.document.open();
	newWindow.document.write('<html>\n<head>\n<meta http-equiv="imagetoolbar" content="no">\n<title>icbaby.com - Baby goods online!</title>\n</head>\n\n<body bgcolor="#FFFFFF" onBlur="self.close()">\n'); 
	newWindow.document.write('<div align="center"><a href="javascript:;self.close()"><img src=' +imageName +' border="0" alt="' +alt +'"></a></div>\n\n');
	newWindow.document.write('<div id="overlay" style="position:absolute; left:50%; margin-left:-225px; top:350px; width:450px; height:100px; z-index:10"> <div align="center"><font color="#FFFFFF" size="6" face="Verdana, Arial, Helvetica, sans-serif"><strong>WWW.ICBABY.COM</strong></font></div></div>\n\n');
	newWindow.document.write('<div id="overlay2" style="position:absolute; left:50%; margin-left:-223px; top:352px; width:450px; height:100px; z-index:9"> <div align="center"><font color="#404040" size="6" face="Verdana, Arial, Helvetica, sans-serif"><strong>WWW.ICBABY.COM</strong></font></div></div>\n\n');
	newWindow.document.write('<a href="javascript:;self.close()" class="enlarge"><p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><img src="/_images/red-x.gif" border="0">CLOSE WINDOW</font></p></a>\n');
	newWindow.document.write('</body>\n</html>');
	newWindow.document.close();
	newWindow.focus();
}
function sortbags() {
	if (document.form.fabric.value!="TAG!=all"){
		location = "/cgi-bin/catalog.pl?db=2&tp=3&records=120&"+document.form.fabric.value+document.form.size.value+document.form.tog.value+"&order_by=SIZE&order=123";
		}else{
	location = "/cgi-bin/catalog.pl?db=2&tp=3&records=120&"+document.form.fabric.value+document.form.size.value+document.form.tog.value+"&order_by=fabric&order=abc";
	}
}
function returl(){
	document.getElementById("ret_url").value= window.location;
}
function sortitems () {
	var sort_order = document.form.order.value;
	var category = document.form.category.value;
	location = "/cgi-bin/catalog.pl?tp=2&search="+category+"&method=perfect&"+sort_order;	
}
function eecWarning() {
	var breadcrumb = document.getElementById('breadcrumb').innerHTML;
	var originalMessage = document.getElementById('message').innerHTML;
	var isCarSeat = breadcrumb.indexOf("Car Seats");
	if (isCarSeat != -1){
		//alert ("EEC WARNING");
		document.getElementById('message').innerHTML = originalMessage + "<br><font size='2' face='Arial, Helvetica, sans-serif'>This product cannot be shipped outside the EU. <br><br><u>NOTE: Not all car seats fit all cars.</u></font>";
		}
}
function review(){
	if (reviewtext==""){
		reviewtext = "No review has been written for this product yet";
		}
		document.write(reviewtext)
}

var query = window.location.search.substring(1);
	if (query == "parenting"){
		var myImage = new Image();
		myImage.src = "/cgi-bin/affiliate_in.pl?parenting";
	}
	
function emailWindow(Q) {
	newWindow = window.open('','newWindow', 'width=500, height=270, scrollbars=yes');
	newWindow.document.open();
	newWindow.document.write('<html>\n<head>\n<meta http-equiv="imagetoolbar" content="no">\n<title>ASK US A QUESTION</title>\n<link href="_includes/classes.css" rel="stylesheet" type="text/css">\n');
	newWindow.document.write('<script language="JavaScript" type="text/JavaScript">\nfunction checkForm(){\nif ((document.getElementById("question").value == "")||(document.getElementById("question").value == "You haven\'t asked a question!")){\ndocument.getElementById("question").value = "You haven\'t asked a question!";\n document.getElementById("question").style.background = "#FFBBBB";\n return false;\n }\n if ((document.getElementById("realname").value == "")||(document.getElementById("realname").value == "You havent included your name.")){\n document.getElementById("realname").value = "You havent included your name.";\n document.getElementById("realname").style.background = "#FFBBBB";\nreturn false;\n }\n if ((document.getElementById("email").value == "")||(document.getElementById("email").value == "Include you email so we can reply to you.")){\n document.getElementById("email").value = "Include you email so we can reply to you.";\n document.getElementById("email").style.background = "#FFBBBB";\n document.getElementById("missing").value="/emailError.htm";\nreturn false;\n }\n }\n </script>\n ');
	
	newWindow.document.write('</head>\n\n<body bgcolor="#FFFFFF">\n'); 
	newWindow.document.write('<form name="form1" method="post" action="/cgi-bin/FormMail.pl" onSubmit="return checkForm()">\n<input type="hidden" name="recipient" value="1" />\n<input type="hidden" name="required" value="question,realname,email" />\n<input type="hidden" name="subject" value="ICbaby Item Query" />\n<input type="hidden" name="redirect" value="http://www.icbaby.com/itemquery.htm" />\n<input type="hidden" name="missing_fields_redirect" id="missing" value="http://127.0.0.1/emailError.htm" />');
	newWindow.document.write('\n<table width="100%" border="0" cellspacing="0" cellpadding="0">');
	newWindow.document.write('<tr>\n<td width="30%" colspan="2"><font size="2" face="Tahoma, Verdana, Arial">Question about:</font></td>\n<td width=""><input name=\"item\" type=\"text\" id=\"item\" value=\"' + Q + '\" size="45" style="font-family: Tahoma, Verdana, Arial;"></td>\n</tr>');
	newWindow.document.write('<tr>\n<td><font size="2" face="Tahoma, Verdana, Arial">Your question:</font></td>\n<td>&nbsp;</td>\n<td><textarea name="question" id="question" cols=35 rows=5></textarea></td>\n</tr>');
	newWindow.document.write('<tr>\n<td><font size="2" face="Tahoma, Verdana, Arial">Your name:</font></td>\n<td>&nbsp;</td>\n<td><input name="realname" type="text" id="realname" size=44></td>\n</tr>');
	newWindow.document.write('<tr>\n<td><font size="2" face="Tahoma, Verdana, Arial">Your email address:</font></td>\n<td>&nbsp;</td>\n<td><input name="email" type="text" id="email" size=44></td>\n</tr>');
	newWindow.document.write('<tr><td colspan=3><br><div align="center"><input type="submit" name="Submit" value="Send question"></div></td></tr>');
	newWindow.document.write('</table>\n</form>');
	newWindow.document.write('</body>\n</html>');
	newWindow.document.close();
	newWindow.focus();
}

function mostPop () {
	/*alert(data1);*/
}
function gsFlash () {
	document.getElementById('gs').innerHTML = "<img src='/_images/goShopAnim.gif' border='0'>";
}