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=640,height=480');
//	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 Jordan or Nike, or any other brand not mentioned herein."+
	            "\n\n-All items are factory variants and custom altered 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 items are in Brand New condition."+
	            "\n\n-Please be sure to check your order status at our tracking page."+
		    "\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\nIMPORTANT NOTE: WE WILL ONLY SHIP TO YOUR CONFIRMED BILLING ADDRESS.";
	//if(confirm(agree))
	//{
		AddToCart(formValue);
	//	return true;
	//}else {return false;}
	
return true;
}