
function submit3p(actionStr) {
SetCookie("action3p", actionStr, null, "/",null,false)
window.location.href = "3p.html"
}

function on3pLoad() {
	var actionStr =  GetCookie("action3p")
	window.frames["3pframe"].location = actionStr 
	window.scrollTo(0,0)	
}

function submit3p2(actionStr) {
	window.location.href = "3p.html"
	window.frames["3pframe"].location = actionStr 
	window.scrollTo(0,0)
}

function submitDDMS() {	
var actionStr = "https://www2.officesupply-link.com/5610/DealerStation/Catalog/News.asp?login=1"
var userStr = document.frmLogin.user.value
var pwStr = document.frmLogin.pw.value
SetCookie("ddmsUser", userStr, null, "/",null,false)
SetCookie("ddmsPw", pwStr, null, "/", null, false)
window.location.href = "3p_orderofcprods.html"
return false
/*document.frmLogin.action = "3p_orderofcprods.html"
document.frmLogin.submit() */
}

function onDDMSLoad() {
    var actionStr = "https://www2.officesupply-link.com/5610/DealerStation/Catalog/News.asp?login=1"
    var userStr = GetCookie("ddmsUser")
	var pwStr =  GetCookie("ddmsPw")
	actionStr = actionStr + "&user="+userStr + "&pw="+pwStr
	window.frames["ddmsframe"].location = actionStr 
	window.scrollTo(0,0)
/*	document.getElementById("ddmsframe").src = actionStr*/	
}

function submitBrowseDDMS() {	
var actionStr = "http://www2.officesupply-link.com/5610/DealerStation/Catalog/EnhancedContent.asp"
var kwStr = document.frmAdvanced.Keywords.value
var actStr = document.frmAdvanced.Action.value
SetCookie("browseKwStr", kwStr, null, "/",null,false)
SetCookie("browseActStr", actStr, null, "/", null, false)
window.location.href = "3p_browseofcprods.html"
return false
/*document.frmLogin.action = "3p_orderofcprods.html"
document.frmLogin.submit() */
}

function onBrowseDDMSLoad() {
	var actionStr = "http://www2.officesupply-link.com/5610/DealerStation/Catalog/EnhancedContent.asp"
    var kwStr = GetCookie("browseKwStr")
	var actStr =  GetCookie("browseActStr")
	actionStr = actionStr + "?Keywords="+kwStr + "&Action="+actStr	
	window.frames["ddmsframe"].location = actionStr 
	window.scrollTo(0,0)
/*	document.getElementById("ddmsframe").src = actionStr*/	
}

function submitOrderPrinting() {	
var actionStr = "https://www.orderprinting.com/default.asp"
var userStr = document.frmOrderPrinting.Name.value
var pwStr = document.frmOrderPrinting.password.value
var langStr = document.frmOrderPrinting.lang.value
var yourNameStr = document.frmOrderPrinting.YourName.value
SetCookie("opUser", userStr, null, "/",null,false)
SetCookie("opPw", pwStr, null, "/", null, false)
SetCookie("opLang", langStr, null, "/", null, false)
SetCookie("opYourName", yourNameStr, null, "/", null, false)
window.location.href = "3p_orderprinting_fwd.html"
return false
/*document.frmLogin.action = "3p_orderofcprods.html"
document.frmLogin.submit() */
}

function onOrderPrintingLoad() {
	var actionStr = "https://www.orderprinting.com/default.asp"
    var userStr = GetCookie("opUser")
	var pwStr =  GetCookie("opPw")
	var langStr = GetCookie("opLang")
	var yourNameStr = GetCookie("opYourName")
	actionStr = actionStr + "?Name="+userStr + "&password="+pwStr + "&lang="+langStr + "&YourName="+yourNameStr
	window.frames["opframe"].location = actionStr 
	window.scrollTo(0,0)
/*	document.getElementById("ddmsframe").src = actionStr*/	
}

function testJS(){
	alert("Here!")
	return false
}

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) {
		endstr = document.cookie.length;
	}
	return unescape(document.cookie.substring(offset, endstr));
}

//
//  Function to correct for 2.x Mac date bug.  Call this function to
//  fix a date object prior to passing it to SetCookie.
//  IMPORTANT:  This function should only be called *once* for
//  any given date object!  See example at the end of this document.
//

function FixCookieDate (date) {
	var base = new Date(0);
	var skew = base.getTime(); // dawn of (Unix) time - should be 0
	if (skew > 0) {
		// Except on the Mac - ahead of its time
		date.setTime (date.getTime() - skew);
	}
}

//
//  Function to return the value of the cookie specified by "name".
//  name - String object containing the cookie name.
//  returns - String object containing the cookie value, or null if
//  the cookie does not exist.
//

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) {
			return getCookieVal (j);
		}
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) {
			break;
		}
	}
	return null;
}

function SetCookie (name,value,expires,path,domain,secure) {
	document.cookie = name + "=" + escape (value) +
            ((expires) ? "; expires=" + expires.toGMTString() : "") +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            ((secure) ? "; secure" : "");
}
      
//  Function to delete a cookie. (Sets expiration date to start of epoch)
//    name -   String object containing the cookie name
//    path -   String object containing the path of the cookie to delete.  This MUST
//             be the same as the path used to create the cookie, or null/omitted if
//             no path was specified when creating the cookie.
//    domain - String object containing the domain of the cookie to delete.  This MUST
//             be the same as the domain used to create the cookie, or null/omitted if
//             no domain was specified when creating the cookie.
//

function DeleteCookie (name,path,domain) {
	if (GetCookie(name)) {
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

function PopupCenter(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var sparam = 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width='+w + ', height='+h + ', top='+top+', left='+left;
window.open(pageURL,title,sparam);
} 
	 
	  

