function niceGeneric() {
	this.syncAll = genSyncAll;
	this.syncAll();
}

function genSyncAll() {
 	this.docWidth = ( document.layers ) ? window.innerWidth : document.body.clientWidth;
	this.docHeight = ( document.layers ) ? window.innerHeight : document.body.clientHeight;
	var agent = navigator.userAgent.toLowerCase();
	if( document.layers && ( agent.indexOf( "mac" ) == -1 ) ) {
		this.docWidth += 4;
		this.docHeight += 4;
	}
	this.docLeft = ( document.layers ) ? window.pageXOffset : document.body.scrollLeft;
	this.docTop = ( document.layers ) ? window.pageYOffset : document.body.scrollTop;
}
//check whether product is a TRIPP TRAPP or not. If TRIPP TRAPP, open window to stokke survey before allowing item to be added to cart
function tryAddToCart(button){
    if(document.getElementById(button.id + "Hidden").value.substr(0, 19) == "MATSTOL TRIPP TRAPP"){
        openStokke();
    }
}
function openStokke(){
    var successUri = "http://www.babyland.se/stokkeSuccess.aspx";
    window.open("http://www.stokke.com/tripptrapp-sale/asp/questions.asp?LANG=11&RETURNSUCCESS=" + successUri,"stokkePopup","height=600,width=700,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
}
function stokkeCheck(){
    if(document.getElementById("stokkeSuccess")){
        if(document.getElementById("stokkeSuccess").value == "yes"){
            opener.location.href = document.getElementById("ctl00_ContentPlaceHolder6_url").value;
            window.close();
        }
    }
}
function submitPaymentForm(){
    document.getElementById("ctl00_contentType").content = "text/html; charset=iso-8859-1";
    document.getElementById("aspnetForm").action = "https://secure.incab.se/verify/bin/babyland/index";
    document.getElementById("aspnetForm").submit();
}