﻿function openPreview(uid){
   window.open("preview.aspx?user="+uid, "winPrev" ,"width=900,height=325,status=0,titlebar=0,location=0,toolbar=0,Scrollbars=yes, resizable=yes");
}

function viewMorePos(uid){
   window.open("viewmoretop.aspx?user="+uid, "winPos" ,"width=900,height=325,status=0,titlebar=0,location=0,toolbar=0,Scrollbars=yes, resizable=yes");
}

function viewMoreCrit(uid){
   window.open("viewmorelow.aspx?user="+uid, "winCrit" ,"width=900,height=325,status=0,titlebar=0,location=0,toolbar=0,Scrollbars=yes, resizable=yes");   
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function SetMIECookie() {
        var isPresent = readCookie("myinsuranceexpert.com");
        if (isPresent != null) {
            if (isPresent == 0) {
                eraseCookie("myinsuranceexpert.com");
                createCookie("myinsuranceexpert.com", 1, 1);
            }
            else {
                eraseCookie("myinsuranceexpert.com");
                createCookie("myinsuranceexpert.com", 0, 1);
            }
        }
        else {
            createCookie("myinsuranceexpert.com", 1, 1);
        }
    }