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_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 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];}
}


var nc = (document.layers) ? true:false
var ie = (document.all) ? true:false
var n6 = (document.getElementById) ? true:false
/** */
function show(div_name) {
	if(ie) {
	  document.all[div_name].style.display="block";
	} else if(nc) {
	  document.layers[div_name].display="block";
	} else if(n6) {
	  document.getElementById(div_name).style.display="block";
	}
}
/** */
function hide(div_name) {
	if(ie) {
	  document.all[div_name].style.display="none";
	} else if(nc) {
	  document.layers[div_name].display="none";
	} else if(n6) {
	  document.getElementById(div_name).style.display="none";
	}
}
/** */
function reminder() {
	popup = window.open("reminder.html", "", "width=340,height=195");
}
/** */
function choose_product(list, button) {
	if(list.options[list.selectedIndex].value != '0') {
		button.disabled=false;	
	} else {
		button.disabled=true;
	}
	//if (restore) selObj.selectedIndex=0;
}
var checkbox_checked = 0;
function check_product(checkBox, id){
	button = document.getElementById(id);
	if(checkBox.checked){
		checkbox_checked++;
	}else{
		checkbox_checked--;
	}
	if(checkbox_checked > 0){
		button.disabled=false;	
	}else{
		button.disabled=true;	
	}
}
function cardIssueVisibility(cardType,divName){

	switch(cardType){
		case "SOLO": 
		case "SWITCH":  $(divName).show();
			  	  		break;
		default: 		$(divName).hide();
						break;
	}
}


/** */
function validate_tc(thisform) {
	/*
	with (thisform) {
		if (t_and_c.checked==false) {
			alert('please read and accept to continue');
			return false;
	    }
	}*/
	return true;
}

function showhide(prefix, show_id, hide_id_list){
	var hide_id_list_arr = hide_id_list.split(";");
	for(index=0; index<hide_id_list_arr.length; index++){
		if(hide_id_list_arr[index]==show_id){
			$(prefix + hide_id_list_arr[index]).show();	
		}else{
			$(prefix + hide_id_list_arr[index]).hide();			
		}
	}
}

function IFrame(parentElement)
{
   // Create the iframe which will be returned
   var iframe = document.createElement("iframe");
   iframe.frameBorder = 0;
 
   // If no parent element is specified then use body as the parent element
   if(parentElement == null)
      parentElement = document.body;
 
   // This is necessary in order to initialize the document inside the iframe
   parentElement.appendChild(iframe);
 
   // Initiate the iframe's document to null
   iframe.doc = null;
 
   // Depending on browser platform get the iframe's document, this is only
   // available if the iframe has already been appended to an element which
   // has been added to the document
   if(iframe.contentDocument)
      // Firefox, Opera
      iframe.doc = iframe.contentDocument;
   else if(iframe.contentWindow)
      // Internet Explorer
      iframe.doc = iframe.contentWindow.document;
   else if(iframe.document)
      // Others?
      iframe.doc = iframe.document;
 
   // If we did not succeed in finding the document then throw an exception
   if(iframe.doc == null)
      throw "Document not found, append the parent element to the DOM before creating the IFrame";
   
   // Create the script inside the iframe's document which will call the
   iframe.doc.open();
   iframe.doc.close();
 
   // Return the iframe, now with an extra property iframe.doc containing the
   // iframe's document
   return iframe;
}