<!--
	
	function setGirlGallery(value){
		if (value == 1){
			getElement("img_gallery_type1").src="images/girl_gallery_type1_on.jpg";
			getElement("img_gallery_type2").src="images/girl_gallery_type2.jpg";
			getElement("img_gallery_type3").src="images/girl_gallery_type3.jpg";

			getElement("gallery2").style.display = "none";
			getElement("gallery3").style.display = "none";
			document.girl_gallery.galleryType.value = 1;
			document.girl_gallery.picNum.value = 7;
		}
		else if (value == 2){
			getElement("img_gallery_type1").src="images/girl_gallery_type1.jpg";
			getElement("img_gallery_type2").src="images/girl_gallery_type2_on.jpg";
			getElement("img_gallery_type3").src="images/girl_gallery_type3.jpg";

			getElement("gallery2").style.display = "";
			getElement("gallery3").style.display = "none";
			document.girl_gallery.galleryType.value = 2;
			document.girl_gallery.picNum.value = 10;
		}
		else if (value == 3){
			getElement("img_gallery_type1").src="images/girl_gallery_type1.jpg";
			getElement("img_gallery_type2").src="images/girl_gallery_type2.jpg";
			getElement("img_gallery_type3").src="images/girl_gallery_type3_on.jpg";

			getElement("gallery2").style.display = "";
			getElement("gallery3").style.display = "";
			document.girl_gallery.galleryType.value = 3;
			document.girl_gallery.picNum.value = 15;
		}
	}
	
	function setGirlGallery1(value,GalleryType){
		if (value == 1){
			getElement("img_gallery_type11").src="images/girl_gallery_type1_on.jpg";
			if (GalleryType != 2)
				getElement("img_gallery_type12").src="images/girl_gallery_type2.jpg";
			if (GalleryType != 3)
				getElement("img_gallery_type13").src="images/girl_gallery_type3.jpg";
		}
		else if (value == 2){
			getElement("img_gallery_type12").src="images/girl_gallery_type2_on.jpg";
			if (GalleryType != 1)
				getElement("img_gallery_type11").src="images/girl_gallery_type1.jpg";
			if (GalleryType != 3)
				getElement("img_gallery_type13").src="images/girl_gallery_type3.jpg";
		}
		else if (value == 3){
			getElement("img_gallery_type13").src="images/girl_gallery_type3_on.jpg";
			if (GalleryType != 1)
				getElement("img_gallery_type11").src="images/girl_gallery_type1.jpg";
			if (GalleryType != 2)
				getElement("img_gallery_type12").src="images/girl_gallery_type2.jpg";
		}
	}
	
	var submittedAlready = false;
	
	function isEmail(Email_ad){
		x = Email_ad.indexOf("@");
		y = Email_ad.indexOf(".");
		if ((x == -1 || y == -1))
			return false;
		else
			return true;
	}
	
	function isPhone(num){
		str = num;
		var re=/[a-zA-Zא-ת]/g;
    if (re.test(str))
  		 return false;  
		else if ((num.length < 9) || (num.length > 11))
			return false;
		else
			return true;
	}

	//SEARCH
	function validSearch() {
		frm = document.searchFrm;
		if (frm.field_search.value == ""){
			alert("Please enter text for search");
			frm.field_search.focus();
			return false;
		}
		else{
			return true;
		}
	}

//checkFrm
	function checkFrm(frm) {
  	for (i=0;i<frm.elements.length;i++) {
			e = frm.elements[i];
			
			/********** field_r_ = required field  *****************************/
			/********** field_rf_ = required field type File *******************/
			/********** field_rp_ = required field type Phone ******************/
			/********** field_re_ = required field type Email ******************/
			/********** field_rs_ = required field type Select *****************/
			/********** field_rd_ = required field type Date *******************/
			/********** field_ru_ = required field type Unik *******************/
			/********** field_rps_ = required field type Password **************/
			/********** fld_rpc_ = required field type Password Confirm ********/
			if ((e.type != 'hidden') && (
				(e.name.substring(0,8) == "field_r_") || (e.name.substring(0,6) == "fld_r_") ||
				(e.name.substring(0,9) == "field_rf_") || (e.name.substring(0,9) == "field_rp_") ||
				(e.name.substring(0,9) == "field_re_") || (e.name.substring(0,9) == "field_rs_") ||
				(e.name.substring(0,9) == "field_rd_") || (e.name.substring(0,9) == "field_ru_") ||
				(e.name.substring(0,8) == "fld_rpc_") || (e.name.substring(0,10) == "field_rps_")
					) && (e.value == "")){
				if ((e.name.substring(0,9) == "field_rf_") && (e.value == "")){
					alert("Please select "+e.title +" by presseing on the (Browse) button");
					e.focus();
					return false;
				}
				else{
					alert("Please enter "+e.title);
					e.focus();
					return false;
				}
			}
			if ((e.name.substring(0,9) == "field_rp_") && (e.value != "") && (!isPhone(e.value))){
				alert("Please enter valid "+e.title);
				e.focus();
				return false;
			}
			if ((e.name.substring(0,9) == "field_re_") && (e.value != "") && (!isEmail(e.value))){
				alert("Please enter valid "+e.title);
				e.focus();
				return false;
			}
			if ((e.name.substring(0,9) == "field_rs_") && ((e.value == "") || (e.value == "0"))){
				alert("Please select "+e.title);
				e.focus();
				return false;
			}
			if (e.type != 'hidden' && (e.name.substring(0,9) == "field_rd_") && (e.value != "") && (!isDate(e.value))){
//				alert("Please enter valid "+e.title);
				e.focus();
				return false;
			}
			if (((e.name.substring(0,10) == "field_rps_") || (e.name.substring(0,8) == "fld_rpc_")) && (e.value != "") && ((e.value.length < 6) || (e.value.length > 12))){
				alert("Please enter valid "+e.title +" (at least 6 characters");
				e.focus();
				return false;
			}
			if ((e.name.substring(0,8) == "fld_rpc_") && (e.value != "") && (e.value != frm.field_rps_password.value)){
				alert("The passwords are not identicals");
				e.focus();
				return false;
			}
			if ((e.name.substring(0,9) == "field_ru_") && (e.value != "")){
				isUnik = checkUnikEmail(e.value);
				alert(isUnik);
				if (isUnik == "no"){
					alert("The Email address you entered is allready registered! \n Please enter unik "+e.title +"");
					e.focus();
					return false;
				}
			}
		}
		if (frm.chk_terms){
			if (!frm.chk_terms.checked) {
				alert("Please read the terms of use and accept the terms");
				frm.chk_terms.focus();
				return false;
			}
		}
//		frm.btnSend.disabled = true;
		if (frm.field_rd_date_birth){
			ldBirthDate = frm.f_month.value +"/"+ frm.f_day.value +"/"+ frm.f_year.value;
			frm.field_rd_date_birth.value = ldBirthDate;
		}
		
		return true;
	}

function checkUnikEmail(lsEmail){
//	alert(liNum)
	retValue = false;
	var xmlHttp;
  try {    // Firefox, Opera 8.0+, Safari    
		xmlHttp=new XMLHttpRequest();    
	}
  catch (e)  {    // Internet Explorer    
		try {      
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
		}
    catch (e) {      
      try {        
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
			}
      catch (e) {        
				alert("Your browser does not support AJAX!");        
				return false;        
			}      
		}    
	}
  xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
//			alert(xmlHttp.responseText)
			retValue = false;
			res = xmlHttp.responseText;
			if (xmlHttp.responseText != 0){
				retValue = "no";
				return retValue;
			}
		}
	}
	
	
  xmlHttp.open("GET","include/checkValidEmail.asp?email="+lsEmail,true);
  xmlHttp.send(null);  
  return retValue;

}


	//SEARCH
	function validSearch() {
		frm = document.searchFrm;
		if (frm.field_search.value == ""){
			alert("Please enter text for search");
			frm.field_search.focus();
			return false;
		}
		else{
			return true;
		}
	}

	var dtCh= "/";
	var minYear=1900;
	var maxYear=2100;

	function isInteger(s){
		var i;
	    for (i = 0; i < s.length; i++){   
	        // Check that current character is number.
	        var c = s.charAt(i);
	        if (((c < "0") || (c > "9"))) return false;
	    }
	    // All characters are numbers.
	    return true;
	}

	function stripCharsInBag(s, bag){
		var i;
	    var returnString = "";
	    // Search through string's characters one by one.
	    // If character is not in bag, append to returnString.
	    for (i = 0; i < s.length; i++){   
	        var c = s.charAt(i);
	        if (bag.indexOf(c) == -1) returnString += c;
	    }
	    return returnString;
	}

	function daysInFebruary (year){
		// February has 29 days in any year evenly divisible by four,
	    // EXCEPT for centurial years which are not also divisible by 400.
	    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
	}
	function DaysArray(n) {
		for (var i = 1; i <= n; i++) {
			this[i] = 31;
			if (i==4 || i==6 || i==9 || i==11) {this[i] = 30;}
			if (i==2) {this[i] = 29;}
	   } 
	   return this;
	}

	function isDate(dtStr){
		var daysInMonth = DaysArray(12);
		var pos1=dtStr.indexOf(dtCh);
		var pos2=dtStr.indexOf(dtCh,pos1+1);
		var strMonth=dtStr.substring(0,pos1);
		var strDay=dtStr.substring(pos1+1,pos2);
		var strYear=dtStr.substring(pos2+1);
		strYr=strYear;
		if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1);
		if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1);
		for (var i = 1; i <= 3; i++) {
			if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1);
		}
		month=parseInt(strMonth);
		day=parseInt(strDay);
		year=parseInt(strYr);
		if (pos1==-1 || pos2==-1){
			alert("The date format should be : mm/dd/yyyy");
			return false;
		}
		if (strMonth.length<1 || month<1 || month>12){
			alert("Please enter a valid month");
			return false;
		}
		if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
			alert("Please enter a valid day");
			return false;
		}
		if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
			alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear);
			return false;
		}
		if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
			alert("Please enter a valid date");
			return false;
		}
	return true;
	}

//PRELOAD IMAGES
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_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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.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_swapBackground(vsID, vsBG) { 
//	alert(vsBG);
	getElement(vsID).src=vsBG;
//  eval("" + vsID + ".src='" + vsBG + "'");
}

function MM_swapBackgroundClass(vsID, vsClass) { 
  eval("" + vsID + ".className='" + vsClass + "'");
}

function showImg(id,url,name){
  tempX = event.clientX + document.body.scrollLeft;
  tempY = event.clientY + document.body.scrollTop;

	document.all.bigPic.src = "uploads/"+url;
	myImage = new Image();
	myImage.src = "uploads/"+url;
	tmpHeight = Math.round(myImage.height * 355 / myImage.width);

	if ((tmpHeight > 0 ) && (tempY > 0)){
		divImage.style.top = tempY-(tmpHeight/2);
		divImage.style.left = tempX+20;
		divImage.style.display = "";
	}
}

function HideImg(){
	divImage.style.display = "none";
}

function displayImage(id,url,name){
	document.imageFrm.imageID.value = id;
	document.getElementById("imageName").innerHTML = name;
	document.all.bigPic.src = "uploads/"+url;
}

function displayImage1(id,url,name,count){
	parent.document.getElementById("imageName").innerHTML = name;
	parent.document.getElementById("imageID").value = id;
	parent.document.all.bigPic.src = "uploads/"+url;
	PictursNum = parent.document.imageFrm.PictursNum.value;
	for(i=0; i<PictursNum;i++){
		document.getElementById("td_thumb_top_"+i+"").innerHTML = "";
		document.getElementById("td_thumb_bottom_"+i).innerHTML = "";
		MM_swapBackgroundClass("thumb_img_"+i,"stateoff");
	}
	document.getElementById("td_thumb_top_"+count+"").innerHTML = '<img src="images/icon_gallery_top_sml.gif" vspace="1">';
	document.getElementById("td_thumb_bottom_"+count).innerHTML = '<img src="images/icon_gallery_bottom_sml.gif" vspace="1">';
	MM_swapBackgroundClass("thumb_img_"+count,"stateon");
}

function displayImage2(vType){
	if (vType == 'n') {
		vID = document.all.bigPic.nid;
		vImg = document.all.bigPic.nimg;
		vName = document.all.bigPic.nname;
	}	
	else {
		vID = document.all.bigPic.pid;
		vImg = document.all.bigPic.pimg;
		vName = document.all.bigPic.pname;
	}	
	document.imageFrm.imageID.value = vID;
	document.getElementById("imageName").innerHTML = vName;
	document.all.bigPic.src = "uploads/"+vImg;
}


function displayVideo(url){
	if (document.mediaPlayer.movie){
		document.getElementById("mediaPlayer").movie = url;
	}
	else{
		document.getElementById("mediaPlayer").src = url;
	}	
}


//OPEN PIC WINDOW
function openPic(id){
//	if (id == 0)
//	id = document.imageFrm.imageID.value;
//	alert(id)
	url = "gallery_pop.asp?n="+id;
	imgWin = window.open(url,'imgWin1','status=no,resizable=no,scrollbars=no,location=no,left=0,top=0,width=700 height=550');
}

function refreshPage(){
	window.location='register_girl_end.asp?s=2';
}

function openPointsWin(){
	url = "images/member_welcome.jpg";
	imgWin = window.open(url,'imgWin1','status=no,resizable=no,scrollbars=no,location=no,left=0,top=0,width=630 height=300');
}

function openNewPost(){
	url = "dialogue_pop.asp";
	imgWin = window.open(url,'imgWin1','status=no,resizable=no,scrollbars=no,location=no,left=0,top=0,width=450 height=550');
}


//OPEN Product pic WINDOW
function openProductPic(id){
	url = "product_pop.asp?itemID="+id;
	imgWin=window.open(url,'imgWin','status=no,resizable=no,scrollbars=no,location=no,left=0,top=0,width=700 height=550');
}

function openOrder(id)
{
	if (id >= 0)
		var OrderWin = window.open ("order_pop.asp?id=" + id, "OrderWin", "menubar=no, adress=no, resizable=no, scrollbars=no, width=750, height=450");
}

function sendToImage(id,miPage)
{
	if (id != 999)
		id = document.imageFrm.imageID.value;
	var sendImage = window.open ("SendImage_pop.asp?page="+miPage+"&ID=" + id, "sendImage", "menubar=no, adress=no, resizable=no, scrollbars=no, width=350, height=300");
}

function printImage(id)
{
	if (id != 999)
		id = document.imageFrm.imageID.value;
	url = "gallery_pop.asp?print=1&id="+id;
	printImage=window.open(url,'printImage','status=no,resizable=no,scrollbars=no,location=no,left=0,top=0,width=400 height=450');
}

function checkSendTo() {
	if (document.sendFrm.email.value == ""){
		alert("נא למלא כתובת מייל של החבר!");
		document.sendFrm.email.focus();
		return false;
	}
	else if (!isEmail(document.sendFrm.email.value)){
		alert("!נא למלא כתובת מייל תקינה");
		document.sendFrm.email.focus();
		return false;
	}
	else if (document.sendFrm.name.value == ""){
		alert("!נא למלא שם");
		document.sendFrm.name.focus();
		return false;
	}
	else
		 return true;
}


//ADD TO FAVORITES
function addToFavorites(root,SiteName) {
	window.external.addfavorite(root,SiteName);
}


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_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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
/*
function openBox(lsOpenName,lsCloseName) {
	alert(lsOpenName)	setTimeout("MM_showHideLayers(lsOpenName,'','show','close_1','','hide')",10);
  return true;
}
  
*/
function closeBox(lsOpenName,lsCloseName) {
	liID = 1;
	setTimeout("MM_showHideLayers('open_1','','hide','close_1','','show')",10);   
  return true;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function gotoCategory(){
	document.categoryFrm.submit();
}

//OPEN VIDEO WINDOW
function openVideo(){
	url = "video_pop.asp";
	videoWin=window.open(url,'videoWin','status=no,resizable=no,scrollbars=no,location=no,left=0,top=0,width=500 height=500');
	
}


function showChangeGallery(){
	lsChangeGallery = getElement("changeGallery");
	if (lsChangeGallery.style.display=='none')
		lsChangeGallery.style.display='block';
	else
		lsChangeGallery.style.display='none';
}

function ShowHideMessage(viCatID){
	if (getElement("AllText" + viCatID))	{
		if (getElement("AllText" + viCatID).style.display=='none')		{
			getElement("AllText" + viCatID).style.display='block';
			getElement("AllText2").style.display='block';
			getElement("AllText3").style.display='none';
		}
		else {
			getElement("AllText" + viCatID).style.display='none';
			getElement("AllText2").style.display='none';
			getElement("AllText3").style.display='block';
		}
	}
}

function ShowHideMessage1(viCatID){
	//alert(eval("Frame" + viCatID + ".location.href"))
	if (eval("document.all.AllText" + viCatID))	{
		if (eval("AllText" + viCatID + ".style.display=='none'"))		{
			eval("AllText" + viCatID + ".style.display='block'");
			eval("btn_close" + viCatID + ".style.display='block'");
			eval("btn_open" + viCatID + ".style.display='none'");
		}
		else {
			eval("AllText" + viCatID + ".style.display='none'");
			eval("btn_close" + viCatID + ".style.display='none'");
			eval("btn_open" + viCatID + ".style.display='block'");
		}
	}
}

function showGalleryQuestions(){
	if (document.getElementById("galleryQuestions").style.display == "none") {
		document.getElementById("galleryQuestions").style.display = "block";
		document.getElementById("imgGalleryShowQ").src = "images/btn_gallery_questions_close.jpg";
	}
	else {
		document.getElementById("galleryQuestions").style.display = "none";
		document.getElementById("imgGalleryShowQ").src = "images/btn_gallery_questions.jpg";
	}
}

function mo(o){o.className=='stateoff'?o.className='stateover': o.className=o.className; }
function mx(o){o.className=='stateover'?o.className='stateoff': o.className=o.className; }

var flag;
function moveLeft(x){
	scrollLeft();
}
function scrollLeft(){
	Gframe.scrollBy(-5,0);
	flag=setTimeout('scrollLeft()', 25);
}
function stopMoveLeft(x){
	clearTimeout(flag);
}

function moveRight(x){
	scrollRight();
}
function scrollRight(){
	Gframe.scrollBy(5,0);
	flag=setTimeout('scrollRight()', 25);
}
function stopMoveRight(x)	{
	clearTimeout(flag);
}

function trig(x)
{
	parent.location.href='video.asp?id='+x;
}

/*
// Disable right click  
var isNS = (navigator.appName == "Netscape") ? 1 : 0;  
if(navigator.appName == "Netscape") 
	document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);  
function mischandler(){   
	return false; 
}  
function mousehandler(e){ 	
	var myevent = (isNS) ? e : event; 	
	var eventbutton = (isNS) ? myevent.which : myevent.button;    
	if((eventbutton==2)||(eventbutton==3)) {
		alert("כל התמונות באתר זה מוגנות בזכויות יוצרים \n ");
		return false; 
	}
} 
document.oncontextmenu = mischandler; 
document.onmousedown = mousehandler; 
document.onmouseup = mousehandler;  

  
*/

function setSelectValue(value){
//	var x=document.getElementById("field_country");
	var x=getElement("field_rs_country");
	for (i=0;i<x.length;i++) {
	  if (x.options[i].value.toLowerCase() == value.toLowerCase()){
			x.options[i].selected = true;
		}
	}
}


function getElement(aID){ 
  return (document.getElementById) ? document.getElementById(aID) : document.all[aID];
//	alert(document.getElementById(aID));
} 

function setTabOn(tab)
{
	if (document.getElementById(tab))	{
		document.getElementById(tab).className+="_over";
	}
}
function setTabOff(tab)
{
	if (document.getElementById(tab))	{
		document.getElementById(tab).className=document.getElementById(tab).className.replace("_over", "");
	}
}

function changeSearchParam(value){
	getElement("searchType").value = value;
	if (value == 1){
		getElement("searchBox1").style.display = '';
		getElement("searchBox2").style.display = 'none';
	}
	else{
		getElement("searchBox1").style.display = 'none';
		getElement("searchBox2").style.display = '';
	}
}

function setProductColor(viProductID,vsColor){
	frm = document.orderFrm;
	viOldProductID = frm.product_id.value;
	viOldColor = frm.color.value;
	if ((viOldProductID != 0) && (viOldColor != 0)){
		getElement("item_color_"+viOldProductID+"_"+viOldColor).className = "";
	}
	getElement("item_color_"+viProductID+"_"+vsColor).className = "itemColorSelected";
	frm.product_id.value = viProductID;
	frm.color.value = vsColor;
}

function setProductSize(viProductID,vsSize){
	frm = document.orderFrm;
	viOldProductID = frm.product_id.value;
	viOldSize = frm.size.value;
	if ((viOldProductID != 0) && (viOldSize != 0)){
		getElement("item_size_"+viOldProductID+"_"+viOldSize).className = "";
	}
	getElement("item_size_"+viProductID+"_"+vsSize).className = "itemSizeSelected";
	frm.product_id.value = viProductID;
	frm.size.value = vsSize;
}

function setProductColorCart(viProductID,vsColor){
	frm = document.cartFrm;
	viOldProductID = frm.product_id.value;
	viOldColor = frm.color.value;
	if ((viOldProductID != 0) && (viOldColor != 0)){
		getElement("item_color_"+viOldProductID+"_"+viOldColor).className = "";
	}
	getElement("item_color_"+viProductID+"_"+vsColor).className = "itemColorSelected";
	frm.product_id.value = viProductID;
	frm.color.value = vsColor;
}

function setProductSizeCart(viProductID,vsSize){
	frm = document.cartFrm;
	viOldProductID = frm.product_id.value;
	viOldSize = frm.size.value;
	if ((viOldProductID != 0) && (viOldSize != 0)){
		getElement("item_size_"+viOldProductID+"_"+viOldSize).className = "";
	}
	getElement("item_size_"+viProductID+"_"+vsSize).className = "itemSizeSelected";
	frm.product_id.value = viProductID;
	frm.size.value = vsSize;
}

function checkAddToCart(viProductID){
	frm = document.orderFrm;
	viOldProductID = frm.product_id.value;
	if (viProductID !=  viOldProductID) {
		frm.product_id.value = viProductID;
		frm.color.value = "";
		frm.size.value = 0;
	}
	document.orderFrm.submit();
}


	function removeFromCart(orderDetailsID){
		if (confirm('Are you sure?')){
			document.cartFrm.op.value="remove";
			document.cartFrm.orderDetailsID.value=orderDetailsID;
			document.cartFrm.submit();
		}
		else
			return false;
	}
	
	function setDiscountProduct(orderDetailsID,isChecked){
		if (isChecked)
			isChecked = 1;
		else
			isChecked = 0;
		if (confirm('Are you sure?')){
			document.cartFrm.op.value="discount";
			document.cartFrm.discType.value=isChecked;
			document.cartFrm.orderDetailsID.value=orderDetailsID;
			document.cartFrm.submit();
		}
		else
			return false;
	}
	
	function orderCart(){
		frm = document.cartFrm;
		if (frm.totalPrice.value > 0){
			frm.op.value="order";
			frm.action="";
			frm.submit();
		}
		else{
			alert("Your cart is empyt! Please select at list one item.");
			return false;
		}
	}
	
	function updateCartItem(orderDetailsID,viProductID){
		frm = document.cartFrm;
		viOldProductID = frm.product_id.value;
		if (viProductID !=  viOldProductID) {
			frm.product_id.value = viProductID;
			frm.color.value = "";
			frm.size.value = 0;
		}

		document.cartFrm.op.value="update";
		document.cartFrm.orderDetailsID.value=orderDetailsID;
		document.cartFrm.submit();
		
	}

	function sendCart(itemsInCart){
		frm = document.buyFrm;
		isOK = 1;
		for (i=1;i<=itemsInCart && isOK == 1;i++){
			if (eval("frm.os0_"+i).value == '') {
				isOK = 0;
				alert('Please select color for every items in the cart\n Please remember to press on the \'Update Item\' button for your changes to take effect!');
			}
			else if (eval("frm.os0_"+i).value == 0) {
				isOK = 0;
				alert('Please select size for every items in the cart\n Please remember to press on the \'Update Item\' button for your changes to take effect!');
			}
		
		}
		if (isOK == 1)
			frm.submit();
	}
	

/*
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementsId("girlsTabs");
		
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="div" && node.className == "tab_small_on") {
				node.onmouseover=function() {
					this.className+="_over";
				}
			  node.onmouseout=function() {
					this.className=this.className.replace("_over", "");
			  }
			}
		}
	 }
}
window.onload=startList;
*/

//-->
