var cookieName = "secSettings=";
function setSECookie(){
var value = (merchSection.style.display != 'none' ? "o":"c") + (merchSection.style.display != 'none' ? parseInt(merchSection.width):"0") + "-" + (ebaySection.style.display != 'none' ? "o":"c") + (ebaySection.style.display != 'none' ? parseInt(ebaySection.width):"0") + "-" + (webSection.style.display != 'none' ? "o":"c") + (webSection.style.display != 'none' ? parseInt(webSection.width):"0");
document.cookie= cookieName + escape(value) + "; expires=" + expireDate.toGMTString() + "; path=/" + "; domain=" + cookieDomain;
}
function getSECookie(){
with(document.cookie){
if (indexOf(cookieName) == -1) return null;
var end = indexOf(";", indexOf(cookieName));
if (end == -1) end = length;
return unescape(substring(indexOf(cookieName) + cookieName.length, end));
}
return null;
}
function initCookie(){
var seCookie = getSECookie();
var colArray;
if(seCookie){
colArray = seCookie.split("-");
}else{
colArray = ["o360", "o360", "o180"];
}
colArray = setColArray(colArray, seCookie);
if(colArray[0].substring(0, 1) == "o"){
resetSectionWidth(merchSection, colArray[0].substring(1, colArray[0].length));
}else{
hideSection( 'merch' );
}
if(colArray[1].substring(0, 1) == "o"){
resetSectionWidth(ebaySection, colArray[1].substring(1, colArray[1].length));
}else{
hideSection( 'ebay' );
}
if(colArray[2].substring(0, 1) == "o"){
resetSectionWidth(webSection, colArray[2].substring(1, colArray[2].length));
}else{
hideSection( 'web' );
}
firstDivider.style.display = (merchSection.style.display == '' && (ebaySection.style.display == '' || webSection.style.display == '')) ? '' : 'none';
secondDivider.style.display = (ebaySection.style.display == '' && webSection.style.display == '') ? '' : 'none';
if(!seCookie) toggleclick('aboutpage');
}
function sectionCheck(sectionName){
var cookieDomain = ".superpages.com";
var expireDate = new Date();
expireDate.setYear(expireDate.getFullYear() + 5);
var seCookie = getSECookie();
var colArray;
if(seCookie){
colArray = seCookie.split("-");
if(colArray){
var tempArray = [colArray[0].substring(0, 1), colArray[1].substring(0, 1), colArray[2].substring(0, 1)];
if(sectionName == "pr" && tempArray[0] == "c")
document.cookie= cookieName + escape(sectionCheckHelp(colArray, 1, 2)) + "; expires=" + expireDate.toGMTString() + "; path=/" + "; domain=" + cookieDomain;
else if(sectionName == "au" && tempArray[1] == "c")
document.cookie= cookieName + escape(sectionCheckHelp(colArray, 0, 2)) + "; expires=" + expireDate.toGMTString() + "; path=/" + "; domain=" + cookieDomain;
}
}
}
function sectionCheckHelp(colArray, altSecNumF, altSecNumS){
var fullWidth = parseInt(colArray[altSecNumF].substring(1)) + parseInt(colArray[altSecNumS].substring(1));
if(fullWidth == 0) fullWidth = 900;
var openSections = 1 + (colArray[altSecNumF].substring(0, 1) =="o") + (colArray[altSecNumS].substring(0, 1) =="o");
var rem = fullWidth % openSections;
var openColWidth = (fullWidth - rem) / openSections;
var sec = 'o'+(parseInt(openColWidth)+parseInt(rem));
var t1 = colArray[altSecNumF].substring(0, 1) == 'c' ? 'c0': 'o'+openColWidth;
var t2 = colArray[altSecNumS].substring(0, 1) == 'c' ? 'c0': 'o'+openColWidth;
return altSecNumF == 1 ? sec+"-"+t1+"-"+t2 : t1+"-"+sec+"-"+t2;
}
function setColArrayHelp(colArray, altSecNum, section){
var fullWidth = parseInt(colArray[altSecNum].substring(1)) + parseInt(colArray[2].substring(1));
var openSections = 1 + displayed(section) + displayed(webSection);
var rem = fullWidth % openSections;
var openColWidth = (fullWidth - rem) / openSections;
var sec = 'o'+(parseInt(openColWidth)+parseInt(rem));
var t1 = colArray[altSecNum].substring(1) == 'c' ? 'c0': 'o'+openColWidth;
var t2 = colArray[2].substring(1) == 'c' ? 'c0': 'o'+openColWidth;
return altSecNum == 1 ? [sec, t1, t2] : [t1, sec, t2];
}
function setColArray(colArray, seCookie){
var tempArray = [colArray[0].substring(0, 1), colArray[1].substring(0, 1), colArray[2].substring(0, 1)];
if(page_type == ""){
return colArray;
}else if(page_type == "ignore-case"){
return ["o360", "o360", "o180"];
}else if(page_type == "promo"){
return ["o450", "o450", "c0"];
}else if(page_type == "merch-cat-browser" || page_type == "merch-type-five"){
if(page_type == "merch-type-five" && tempArray[0] == "c")
return colArray;
else if(page_type == "merch-cat-browser" && tempArray[0] == "c"){
return setColArrayHelp(colArray, 1, merchSection);
}
if(seCookie){
if(tempArray[1] == 'c' && tempArray[2] == 'c')
tempArray = [tempArray[0] + 900, tempArray[1] + 0, tempArray[2] + 0];
if(tempArray[1] == 'o' && tempArray[2] == 'c')
tempArray = [tempArray[0] + 450, tempArray[1] + 450, tempArray[2] + 0];
if(tempArray[1] == 'c' && tempArray[2] == 'o')
tempArray = [tempArray[0] + 450, tempArray[1] + 0, tempArray[2] + 450];
if(tempArray[1] == 'o' && tempArray[2] == 'o')
tempArray = [tempArray[0] + 450, tempArray[1] + 225, tempArray[2] + 225];
}else{
tempArray = [tempArray[0] + 450, tempArray[1] + 270, tempArray[2] + 180];
}
}else if(page_type == "ebay-cat-browser"){
if(tempArray[1] == "c")
return setColArrayHelp(colArray, 0, ebaySection);
if(seCookie){
if(tempArray[0] == 'c' && tempArray[2] == 'c')
tempArray = [tempArray[0] + 0, tempArray[1] + 900, tempArray[2] + 0];
if(tempArray[0] == 'o' && tempArray[2] == 'c')
tempArray = [tempArray[0] + 450, tempArray[1] + 450, tempArray[2] + 0];
if(tempArray[0] == 'c' && tempArray[2] == 'o')
tempArray = [tempArray[0] + 0, tempArray[1] + 450, tempArray[2] + 450];
if(tempArray[0] == 'o' && tempArray[2] == 'o')
tempArray = [tempArray[0] + 225, tempArray[1] + 450, tempArray[2] + 225];
}else{
tempArray = [tempArray[0] + 270, tempArray[1] + 450, tempArray[2] + 180];
}
}else if( -1 < page_type.indexOf("merch-compare")){
var twoWidths;
var threeWidths;
if(seCookie){
if(-1 < page_type.indexOf("2")){
twoWidths = [450,450]; threeWidths=[450,225,225];
} else if(-1 < page_type.indexOf("3")){
twoWidths = [585,315]; threeWidths=[585,180,135];
} else {
twoWidths = [720,180]; threeWidths=[720,90,90];
}
if(tempArray[1] == 'c' && tempArray[2] == 'c')
tempArray = [tempArray[0] + 900, tempArray[1] + 0, tempArray[2] + 0];
if(tempArray[1] == 'o' && tempArray[2] == 'c')
tempArray = [tempArray[0] + twoWidths[0], tempArray[1] + twoWidths[1], tempArray[2] + 0];
if(tempArray[1] == 'c' && tempArray[2] == 'o')
tempArray = [tempArray[0] + twoWidths[0], tempArray[1] + 0, tempArray[2] + twoWidths[1]];
if(tempArray[1] == 'o' && tempArray[2] == 'o')
tempArray = [tempArray[0] + threeWidths[0], tempArray[1] + threeWidths[1], tempArray[2] + threeWidths[2]];
}else{
if(-1 < page_type.indexOf("2")){
threeWidths=[450,270,180];
} else if(-1 < page_type.indexOf("3")){
threeWidths=[585,225,90];
} else {
threeWidths=[720,135,45];
}
tempArray = [tempArray[0] + threeWidths[0], tempArray[1] + threeWidths[1], tempArray[2] + threeWidths[2]];
}
}else if( -1 < page_type.indexOf("ebay-compare")){
var twoWidths;
var threeWidths;
if(seCookie){
if(-1 < page_type.indexOf("2")){
twoWidths = [450,450]; threeWidths=[225,450,225];
} else if(-1 < page_type.indexOf("3")){
twoWidths = [315,585]; threeWidths=[180,585,135];
} else {
twoWidths = [180,720]; threeWidths=[90,720,90];
}
if(tempArray[0] == 'c' && tempArray[2] == 'c')
tempArray = [tempArray[0] + 0, tempArray[1] + 900, tempArray[2] + 0];
if(tempArray[0] == 'o' && tempArray[2] == 'c')
tempArray = [tempArray[0] + twoWidths[0], tempArray[1] + twoWidths[1], tempArray[2] + 0];
if(tempArray[0] == 'c' && tempArray[2] == 'o')
tempArray = [tempArray[0] + 0, tempArray[1] + twoWidths[1], tempArray[2] + twoWidths[0]];
if(tempArray[0] == 'o' && tempArray[2] == 'o')
tempArray = [tempArray[0] + threeWidths[0], tempArray[1] + threeWidths[1], tempArray[2] + threeWidths[2]];
}else{
if(-1 < page_type.indexOf("2")){
threeWidths=[270,450,180];
} else if(-1 < page_type.indexOf("3")){
threeWidths=[225,585,135];
} else {
threeWidths=[135,720,45];
}
tempArray = [tempArray[0] + threeWidths[0], tempArray[1] + threeWidths[1], tempArray[2] + threeWidths[2]];
}
}
if(tempArray[0].length == 1)
return colArray;
return tempArray;
}
