function viewPic1(img, title)
{ 	
    picfile = new Image(); 
    picfile.src =(img); 
    fileCheck(img, title); 
} 

function viewPic(szURL, title)
{
	  //  szName ='iopen';
	    picfile = new Image(); 
    picfile.src =(szURL); 
        ht = picfile.height + 30+35;
    wd = picfile.width + 20; 

    var args= "height=" + ht + ",innerHeight=" + ht;
    args += ",width=" + wd + ",innerWidth=" + wd;
    if (window.screen) 
    { 
        var avht = screen.availHeight; 
        var avwd = screen.availWidth;
        var xcen = (avwd - wd) / 2; 
        var ycen = (avht - ht) / 2;
        args += ",left=" + xcen + ",screenX=" + xcen;
        args += ",top=" + ycen + ",screenY=" + ycen + ",resizable=yes"; 	
    }
    
    CONTENT = "<HTML><HEAD><TITLE>"+title+"</TITLE></HEAD>" + "<BODY><CENTER><IMG SRC='" + szURL + "' BORDER=0>" + "<P><FORM><INPUT TYPE='BUTTON' VALUE='Close' onClick='window.close()'></FORM>" + "</CENTER>"+ "</BODY></HTML>";

	openWindow = window.open(szURL, 'iopen', 'width=250,height=250');
//	openWindow.document.open();
	openWindow.focus();
//	openWindow.document.write(CONTENT);
//	openWindow.document.close();
	
	return;
}

function fileCheck(img, title)
{ 	
    if( (picfile.width!=0) && (picfile.height!=0) )
    { 
        makeWindow(img, title); 
    }
    else 
    {
        funzione="fileCheck('"+img+"', '"+title+"')"; 
        intervallo=setTimeout(funzione,10); 
    }
}


function makeWindow(img, title) { 

    ht = picfile.height + 30+35;
    wd = picfile.width + 20; 

    var args= "height=" + ht + ",innerHeight=" + ht;
    args += ",width=" + wd + ",innerWidth=" + wd;
    if (window.screen) 
    { 
        var avht = screen.availHeight; 
        var avwd = screen.availWidth;
        var xcen = (avwd - wd) / 2; 
        var ycen = (avht - ht) / 2;
        args += ",left=" + xcen + ",screenX=" + xcen;
        args += ",top=" + ycen + ",screenY=" + ycen + ",resizable=yes"; 	
    }


//CONTENT = "<HTML><HEAD><TITLE>"+title+"</TITLE></HEAD>" + "<BODY><CENTER><IMG SRC='" + img + "' BORDER=0>" + "<P><FORM><INPUT TYPE='BUTTON' VALUE='Close' onClick='window.close()'></FORM>" + "</CENTER>"+ "</BODY></HTML>";

pop = window.open(img,'iopen',args);
//pop.document.open();
pop.focus();
//pop.document.write(CONTENT);
//pop.document.close();


} 


function checksize(formValue,getsize1)
{
	if(getsize1 == "Select Size")
	{	
		alert("Please select a size.");
		return false;
	}
        if(getsize1 == "Out of Stock")
        {	alert("This item is Out of Stock.");
		return false;
        }
        if(getsize1 == "Sold Out")
        {	alert("This item has Sold Out.");
         	return false;
        }

//	var agree = "By purchasing from Cankicks and clicking 'OK' you Agree to accept all points listed below:"+
//	            "\n\n-CanKicks has no affiliation with Gucci, Louis Vuitton, Jordan or Nike, or any other brand not mentioned herein."+
//	            "\n\n-All shoes are Factory Variants and are custom altered replica. These are shoes that are made in unreleased colors, and are not sold anywhere else and have never been released. All shoes are made with very high quality standards."+
//	            "\n\n-All shoes are in Brand New dead stock condition."+
//		    "\n\n-Customers may not change style/size after order is processed."+
//		    "\n\n-Please refer to our policy: www.cankicks.com/policy.htm for further details."+
//		    "\n\nPLEASE NOTE: Sizes 10.5-12 for Bape Stas run 0.5 smaller. A size 12 will fit like an 11.5 etc."+
//		    "\n\nIMPORTANT NOTE: WE WILL ONLY SHIP TO YOUR CONFIRMED BILLING ADDRESS.";
//	if(confirm(agree))
	//{
			AddToCart(formValue);
	//	return true;
	//}else {return false;}
	
return true;
}