function changeclass(divid,classname){
document.getElementById(divid).className=classname;
}

function showtabs(par,tabid,no){
for(var i=1;i<=no;i++){
	$("#"+par+"tab"+i).hide("slow");
	changeclass(par+'taba'+i,"");
}
changeclass(par+'taba'+tabid,"select");
$("#"+par+"tab"+tabid).show("slow");
}

function choose_curr(v){
document.currencies_top.currency.value=v;
document.currencies_top.submit();
}



var errormsg="";
var isfocus=0;
function exist(id){
 var s=document.getElementById(id);
 if(s) {
  return true;
 }
 else{
  return false;
 }
}

function isdisable(id){
return document.getElementById(id).disabled;
}


function Product_info_test_property(){
if (exist('attrib-1')){
if(!isdisable('attrib-1')){
if((document.getElementById('attrib-1').selectedIndex)*1==0){
errormsg=errormsg+"Please Select Your Size! \n";
if(isfocus*1==0){
document.getElementById('attrib-1').focus();
isfocus=1;
}
}
}
}

if (exist('attrib-2')){
if(!isdisable('attrib-2')){
if((document.getElementById('attrib-2').selectedIndex)*1==0){
errormsg=errormsg+"Please Select Your Child Size! \n";
if(isfocus*1==0){
document.getElementById('attrib-2').focus();
isfocus=1;
}
}
}
}


if (exist('attrib-3')){
if(!isdisable('attrib-3')){
if((document.getElementById('attrib-3').selectedIndex)*1==0){
errormsg=errormsg+"Please Select Your Junior Size! \n";
if(isfocus*1==0){
document.getElementById('attrib-3').focus();
isfocus=1;
}
}
}
}


if (exist('attrib-10')){
if(!isdisable('attrib-10')){
if((document.getElementById('attrib-10').selectedIndex)*1==0){
errormsg=errormsg+"Please Select Your Color! \n";
if(isfocus*1==0){
document.getElementById('attrib-10').focus();
isfocus=1;
}
}
}
}


if (exist('attrib-11')){
if(!isdisable('attrib-11')){
if((document.getElementById('attrib-11').selectedIndex)*1==0){
errormsg=errormsg+"Please Select Your color! \n";
if(isfocus*1==0){
document.getElementById('attrib-11').focus();
isfocus=1;
}
}
}
}


if (exist('check_attr')){
if (document.getElementById('check_attr').checked){


if (exist('attrib-12-0')){
if(!isdisable('attrib-12-0')){
if((document.getElementById('attrib-12-0').value)==""){
errormsg=errormsg+"Please Input Your Bust! \n";
if(isfocus*1==0){
document.getElementById('attrib-12-0').focus();
isfocus=1;
}
}
}
}

if (exist('attrib-13-0')){
if(!isdisable('attrib-13-0')){
if((document.getElementById('attrib-13-0').value)==""){
errormsg=errormsg+"Please Input Your Waist \n";
if(isfocus*1==0){
document.getElementById('attrib-13-0').focus();
isfocus=1;
}
}
}
}

if (exist('attrib-14-0')){
if(!isdisable('attrib-14-0')){
if((document.getElementById('attrib-14-0').value)==""){
errormsg=errormsg+"Please Input Your Hips \n";
if(isfocus*1==0){
document.getElementById('attrib-14-0').focus();
isfocus=1;
}
}
}
}

if (exist('attrib-15-0')){
if(!isdisable('attrib-15-0')){
if((document.getElementById('attrib-15-0').value)==""){
errormsg=errormsg+"Please Input Your Hollow to Hem \n";
if(isfocus*1==0){
document.getElementById('attrib-15-0').focus();
isfocus=1;
}
}
}
}


if (exist('attrib-16-0')){
if(!isdisable('attrib-16-0')){
if((document.getElementById('attrib-16-0').value)==""){
errormsg=errormsg+"Please Input Your Height \n";
if(isfocus*1==0){
document.getElementById('attrib-16-0').focus();
isfocus=1;
}
}
}
}
}
}

<!--normal end-->

if (exist('attrib-7-0')){
if (exist('attrib-4-0')){
if(!isdisable('attrib-4-0')){
if((document.getElementById('attrib-4-0').value)==""){
errormsg=errormsg+"Please Input Your Bust \n";
if(isfocus*1==0){
document.getElementById('attrib-4-0').focus();
isfocus=1;
}
}
}
}

if (exist('attrib-5-0')){
if(!isdisable('attrib-5-0')){
if((document.getElementById('attrib-5-0').value)==""){
errormsg=errormsg+"Please Input Your Upper Bust \n";
if(isfocus*1==0){
document.getElementById('attrib-5-0').focus();
isfocus=1;
}
}
}
}

if (exist('attrib-6-0')){
if(!isdisable('attrib-6-0')){
if((document.getElementById('attrib-6-0').value)==""){
errormsg=errormsg+"Please Input Your Around Bust \n";
if(isfocus*1==0){
document.getElementById('attrib-6-0').focus();
isfocus=1;
}
}
}
}

if (exist('attrib-7-0')){
if(!isdisable('attrib-7-0')){
if((document.getElementById('attrib-7-0').value)==""){
errormsg=errormsg+"Please Input Your Around Belly \n";
if(isfocus*1==0){
document.getElementById('attrib-7-0').focus();
isfocus=1;
}
}
}
}

if (exist('attrib-8-0')){
if(!isdisable('attrib-8-0')){
if((document.getElementById('attrib-8-0').value)==""){
errormsg=errormsg+"Please Input Your Hips \n";
if(isfocus*1==0){
document.getElementById('attrib-8-0').focus();
isfocus=1;
}
}
}
}

if (exist('attrib-9-0')){
if(!isdisable('attrib-9-0')){
if((document.getElementById('attrib-9-0').value)==""){
errormsg=errormsg+"Please Input Your Hollow to Hem \n";
if(isfocus*1==0){
document.getElementById('attrib-9-0').focus();
isfocus=1;
}
}
}
}
}


	
if (errormsg==""){
document.cart_quantity.submit();
}
else{
alert(errormsg);
}

errormsg="";
isfocus=0;
}



function check_attr_input(){
 if (document.getElementById('check_attr').checked == true) 
    { 
	if(document.getElementById('attrib-1') != null && document.getElementById('attrib-1') !='' ) {document.getElementById('attrib-1').selectedIndex=0;document.getElementById('attrib-1').disabled=true;}
	if(document.getElementById('attrib-2') != null && document.getElementById('attrib-2') !='' ) {document.getElementById('attrib-2').selectedIndex=0;document.getElementById('attrib-2').disabled=true;}
	if(document.getElementById('attrib-3') != null && document.getElementById('attrib-3') !='' ) {document.getElementById('attrib-3').selectedIndex=0;document.getElementById('attrib-3').disabled=true;}	
		$('#customsize').show('fast');
 	} else{
	if(document.getElementById('attrib-1') != null && document.getElementById('attrib-1') !='' ) {document.getElementById('attrib-1').disabled=false;}
	if(document.getElementById('attrib-2') != null && document.getElementById('attrib-2') !='' ) {document.getElementById('attrib-2').disabled=false;}
	if(document.getElementById('attrib-3') != null && document.getElementById('attrib-3') !='' ) {document.getElementById('attrib-3').disabled=false;}
	   $('#customsize').hide('fast');
	}
	
}

function deleteall(){
	var names=document.getElementsByName("cart_quantity[]");
	for( var i=0;i<names.length;i++){
		names[i].value=0;
	}
	document.cart_quantity.submit();
}

function isEmail(str) {   
        var re = /^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;   
        return re.test(str);   
    } 
	function isEmailSpan(id) {   
        var val = document.getElementById(id);   
        if (!this.isEmail(val.value)) {   
            val.select();   
            var str = "Please enter a valid email address!";   
           	alert(str);  
            return false;   
        } else {    
            return true;   
        }   
    }   

