var OrderPlace = '-1';
var ALLOWPAGING = true;
var WORKFLOW_PARENT_PRODUCT = new Array();
var WORKFLOW_PRODUCT = null;
var WORKFLOW_PRODUCT_MANDATORY = 0;
var WORKFLOW_PRODUCT_CURRENT = 0;
var CatClick = false
var ProClick = false
var PAGE_SHOPPINGCART = "http://" + window.location.host + "/Shopping/Cart.aspx";
var PAGE_WORKFLOWPRODUCT = "http://" + window.location.host + "/shopping/SystemOrders.aspx";
var PAGE_WORKFLOWORDER = "http://" + window.location.host + "/shopping/SystemOrders.aspx";
var _WorkflowProduct = null;
var _NavigationCommands = null;
var _CurrentWorkflowProduct = null;
var _Workflows = new Array();
var _WorkflowProducts = new Array();
var _WorkflowCounter = 0;
var _Domain = "http://" + window.location.host;
var catloadCheckerNew, advertisementCheckerNew, bannerCheckerNew = "Done";
var loadPagesImageNew;
var mainPagePicNew;
var fullDomainNameNew = "";
var CurrentProductID = 0;
var navigateToHomeNew = false;
var topCategoryNew, leftCategoryNew;
var mainscriptCheck;
var mainscript_Load_Caller;
var frameLoading;
var _ProductCommands;
var _SlideShowCommands;
var dom;
var _wizardGlobalChk;
var _relatedresultchk;
var fullScreenIframeSrc;
var catComView = '';
var sldbox = 1;
var horizontalDefaultCat = 1;
var resizeInfiniViewWithResolution = false;
var IpRedirect = false;
fullViewWithURLsNew();
var fullPageWidth = screen.width * 0.95;
var CurrentProductPrice = "0.00";
var timer;
var sliderTimer;
var TimeToWaitForFilesToLoad = 1;
var CycleFileDelay = 20;
var currentImageNo = 0;
var MuteState;
var mute_image = "../images/sound.gif";
var sound_image = "../images/mute.gif";
var CurrentSlideShow = 0;
var product_image = "images/cat_img/new/product.gif";
var simple_image = "images/cat_img/new/convince_simple.gif";
mainscriptCheck = "Loaded";
mainscript_Load_Caller = "loading";
catloadCheckerNew = "Done";
advertisementCheckerNew = "Done";
bannerCheckerNew = "Done";
var ns4 = (document.layers) ? true : false
var ie4 = (document.all) ? true : false
var loadPagesImageNewCenter = "<img src='../images/ProgressBar.gif' border='0' vAlign='middle' align='center' />"; // image shows while data loaded
var loadPagesImageNewCenterNew = "<img src='../images/ProgressBar.gif' border='0' vAlign='middle' align='center' width='15px' height='15px' />"; // image shows while data loaded
var loadPagesImageNew = "<table width='100%' height='100%' border='0' cellpadding='0' cellspacing='0'><tr><td align='center' valign='bottom' class='LoadingText'></td></tr><tr><td align='center' valign='top'>" + loadPagesImageNewCenter + "</td></tr></table>";
var mainPagePicNew = "../Images_Private/Main_Image/main.html"; // Main default page center picture
var USE_DATABASE_PRODUCTCOMMANDS = false;
var USE_FILESYSTEM_PROUDCTCOMMANDS = true;
var Filetype = "";
var Typestepno = "";
var SharedProdId = "";
var CheckSharedURL = "";
var checkSearchResult = false;
var RedirectedToWorkflowOrder = null;
var _mainCateId, _mainCatImage;
_mainCatImage = null;
_mainCateId = null;
var isIPhone = GetUAgent();
var descriptiontext;
var navigatesrc;
var ptype = "";
var CFname = "";
var directSearchProductId = "";
var CouponWindow = false;
var tblDate_bgcolor;
function CheckBrowserNew(chkTOP) {
if (window.location.search.length > 0 && IpRedirect == false) {
setTimeout('addJsElementNew()', 1000);
}
}
function defaultPageBannerVisibleNew() {
}
function initnew() {
if (GetUAgent() == "") {
if (ns4 || ie4) {
if (ns4) block = document.dynamic
if (ie4) block = dynamic.style
block.x = parseInt(block.left);
}
}
SelectDefaultLanguageNew();
var qsVariableName, qsVariableValue;
var query = location.href;
query = query.substring(query.indexOf('?') + 1, query.length);
qsVariableName = query.substring(0, query.indexOf('='))
qsVariableValue = query.substring(query.indexOf('=') + 1, query.length);
if ((qsVariableName.toLowerCase()) == "didro") {
if (document.getElementById("LogoTable")) {
document.getElementById("LogoTable").style.display = 'none';
}
document.getElementById("leftbartable").style.display = 'none';
SetSourceNew('/shopping/checkout.aspx' + '?OrderID=' + qsVariableValue);
}
if (window.location.search.length <= 0 || IpRedirect == true) {
}
}
function CatgeoryMenuSingle() {
CheckMenu();
if (catComView == "topper") {
FrameSize('Large');
}
if (window.location.search.length <= 0 || IpRedirect == true || checkSearchResult == true || isIPhoneApp() == true || GetUAgent() != "") {
if (catComView == "topper") {
FrameSize('Large');
catloadCheckerNew = "Done";
checkMainInterFaceNew();
}
else {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
if (GetUAgent() != "") {
req.open("GET", "Catalog/NewCatPageDis.aspx?iphone=true", true);
}
else {
req.open("GET", "Catalog/NewCatPageDis.aspx", true);
}
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
if (GetUAgent() != "") {
document.getElementById("DIV_LIST").innerHTML = "";
document.getElementById("DIV_LIST").innerHTML = req.responseText;
document.getElementById("catBall").innerHTML = "";
}
else {
document.getElementById("DIV_LIST").innerHTML = "";
document.getElementById("DIV_LIST").innerHTML = req.responseText;
document.getElementById("catBall").innerHTML = "";
catloadCheckerNew = "Done";
checkMainInterFaceNew();
myMainCategoryMovingNew();
}
}
else {
}
}
req.send("");
}
if (GetUAgent() == "") {
SetObjectSizeNew("DIV_LIST", 220, 314);
}
}
}
}
function CatLoadCallerNew() {
if (!navigateToHomeNew == true) {
if (window.location.search.length > 0 && IpRedirect == false) {
var query_new = window.location.search.substring(1);
var vars = query_new.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0].toLowerCase() == "prourl_id") {
if (GetUAgent() != "") {
HideLogo_wap();
}
SharedProdId = pair[1];
}
else if (pair[0].toLowerCase() == "type") {
Filetype = pair[1];
}
else if (pair[0].toLowerCase() == "step") {
Typestepno = pair[1];
}
else if (pair[0].toLowerCase() == "categoryid") {
if (GetUAgent() != "") {
}
SetIframeMenuSrc(pair[1]);
}
else if (pair[0].toLowerCase() == "cartid") {
if (GetUAgent() != "") {
}
HideBottomPagebannersNew();
var fullURL = window.location.search;
var SubURL = fullURL.substring(fullURL.indexOf('&'), fullURL.length);
if (SubURL.indexOf('cartid') == -1) {
var SpUrl = 'http://' + window.location.host + '/Catalog/Questions.aspx?product_id=' + pair[1] + SubURL;
}
else {
var SpUrl = 'http://' + window.location.host + '/Catalog/Questions.aspx?product_id=' + pair[1];
}
SetSourceNewWithCommands(SpUrl);
downslideNew();
}
else if (pair[0].toLowerCase() == "navigateto") {
HideLogo_wap();
if (pair[1].toLowerCase() == "thanks") {
if (GetUAgent() != "") {
}
navigatesrc = true;
NavigateToThanks();
}
}
else if (pair[0].toLowerCase() == "description") {
if (navigatesrc == true) {
NavigateToThanks(pair[1]);
}
}
else if (pair[0].toLowerCase() == "ptype") {
ptype = pair[1];
}
else if (pair[0].toLowerCase() == "cfname") {
CFname = unescape(pair[1]);
}
else if (pair[0].toLowerCase() == "directsearchproductid") {
CurrentProductID = pair[1];
currentRelatedProId = CurrentProductID;
}
else if (pair[0].toLowerCase() == "frameurl") {
DirectToShareURLFB();
}
}
if (SharedProdId != "") {
if (window.location.host == 'shops.infini.com') {
var url = window.location.protocol + "//" + window.location.host + "/Mobile/ProductFile.aspx?product_id=" + SharedProdId + "&Display=rating";
SetSourceNew(url);
return;
}
CurrentProductID = SharedProdId;
var url = "http://" + window.location.host + "/AJAX/WorkFlowCheckSharedURL.aspx?ProID=" + SharedProdId;
var xmlRequest = DoCallbackNew(url, "")
if (xmlRequest) {
var str = xmlRequest.responseText;
if (str.toLowerCase() == 'true') {
var W_URL = "http://" + window.location.host + "/shopping/SystemOrders.aspx" + "?product_id=" + SharedProdId;
SetSource(W_URL);
}
else {
NavigateToProductFromSupportNew(SharedProdId);
myMainCategoryMovingNew();
checkMainInterFaceNew();
}
}
}
if (CheckEQuotequeryStringNewNew() == true) { return; }
if (CheckWorkflowQueryStringNew() == true) { return; }
var urlQuery = window.location.search;
GlobalMpQuery = urlQuery;
var MP_Query = queryStringNew("Query")
if (MP_Query == 'bestoffer') {
FrameSize('');
MP_Query = '\BestOffer/Default.aspx' + urlQuery;
parent.document.getElementById('frame_details').src = MP_Query;
var MyDiv = document.getElementById('ACTIVECOMMANDS');
MyDiv.style.visibility = 'visible';
MyDiv.innerHTML = '<img src=\Images/pro-2-chkout.jpg onClick=MarketPlace_CheckOut("checkout") /> ';
downslideNew();
}
else if (MP_Query == 'imp_cart') {
FrameSize('');
var QueryType = queryStringNew("Query");
var type = queryStringNew("type");
var mp_id = queryStringNew("mp_id");
var merchant_product_id = queryStringNew("merchant_product_id");
var mp_product_id = queryStringNew("mp_product_id");
var price = queryStringNew("price");
var Quantity = queryStringNew("Quantity");
var bidid = queryStringNew("bidid");
var original_product_id = queryStringNew("original_product_id");
CurrentProductID = original_product_id;
CurrentProductPrice = price;
ShowHideProductCommandsNew('Product', CurrentProductID, window.location.search, CurrentProductID, 'nosearch');
totalPriceRemoverNew();
RelatedProductNew(original_product_id);
downslideNew();
}
else if (MP_Query == 'infinioffice') {
SetSourceNew("Customer/Home.aspx");
downslideNew();
}
else if (MP_Query == 'ebay') {
SetSourceNew("Ajax/ebay.aspx?eBayLogId=" + queryStringNew("eBayLogID"));
}
else if (queryStringNew("qstr") == 'controlledbid') {
FrameSize('');
downslideNew();
RedirectPlaceBidNew();
}
else if (queryStringNew("qstr") == 'login') {
FrameSize('');
downslideNew();
var url = "http://" + window.location.host + "/MP_AJAX/displayDescription.aspx" + GlobalMpQuery + "&checkBanner=true&_screen=" + screen.width;
var xmlRequest = DoCallbackNew(url, "")
if (xmlRequest) {
var str = xmlRequest.responseText;
if (str == 'ok') {
var merchant_id = queryStringNew("merchant_product_id");
src = '../ProductFiles/' + merchant_id + '/1/1/resolution/index.htm';
SetSourceNewWithCommands(src);
}
else {
SetSourceNewWithCommands("http://" + window.location.host + "/MP_AJAX/displayDescription.aspx" + GlobalMpQuery);
}
}
var url = "http://" + window.location.host + "/MP_AJAX/MP_ProductDetails.aspx" + GlobalMpQuery;
var xmlRequest = DoCallbackNew(url, "")
if (xmlRequest) {
var str = xmlRequest.responseText;
var MyDiv = document.getElementById('ACTIVECOMMANDS');
MyDiv.style.visibility = 'visible';
MyDiv.innerHTML = str;
}
else {
var MyDiv = document.getElementById('ACTIVECOMMANDS');
MyDiv.style.VISIBILITY = 'visible';
MyDiv.innerHTML = str;
}
document.getElementById("BottomBannerTD").style.display = "none";
}
else if (queryStringNew('type') == 'profile') {
FrameSize('');
downslideNew();
ProfileBidNew();
}
else if (MP_Query == 'true') {
FrameSize('');
downslideNew();
var src = queryStringNew("productid");
src = "\ImageHandler.ashx?imp_pid=" + src;
BestOfferBidNew();
document.getElementById("BottomBannerTD").style.display = "none";
}
else if (MP_Query == 'NavigateToProductFromSupportNew') {
NavigateToProductFromSupportNew(queryStringNew("productid"));
}
else if (MP_Query == 'infinimarket') {
FrameSize('');
downslideNew();
SetSourceNew("Mp_Ajax/Mp_login.aspx?" + window.location.search);
}
}
SearchCompany();
navigateToHomeNew = false;
}
}
function defaultPageBannerNew() {
var screen_height = screen.height;
var screen_width = screen.width;
var IFrame = document.getElementById("frame_details");
var MainTable = document.getElementById("Page_Table");
if ((screen_width <= 1023) || (screen_height <= 767)) {
document.getElementById("Banner_left").style.display = "none";
document.getElementById("Banner_bottom").style.display = "block";
document.getElementById("Banner_right").style.display = "none";
document.getElementById("ag").style.verticalAlign = "middle";
myMainCategoryMovingNew();
}
else if ((screen_width <= 1279) || (screen_height <= 1023)) {
if (resizeInfiniViewWithResolution == false) {
document.getElementById("Banner_left").style.display = "block";
document.getElementById("Banner_bottom").style.display = "block";
} else {
MainTable.width = fullPageWidth // Returns "972.8" on Resoluation 1024x768;
}
document.getElementById("ag").style.verticalAlign = "middle";
myMainCategoryMovingNew();
}
else if ((screen_width >= 1280) || (screen_height >= 1024)) {
if (resizeInfiniViewWithResolution == false) {
document.getElementById("Banner_left").style.display = "block";
document.getElementById("Banner_bottom").style.display = "block";
document.getElementById("Banner_right").style.display = "block";
} else {
MainTable.width = fullPageWidth			///"1200"
MainTable.height = screen.height * 0.8		// 80% of Screen Resolution
}
document.getElementById("ag").style.verticalAlign = "Top";
}
bannerCheckerNew = "Done";
FrameSetDefault();
}
function LoadAdvertisementsNew() {
document.getElementById("DIV_BOTTOM").innerHTML = loadPagesImageNew;
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("POST", "AJAX/Advertisements.aspx", true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
document.getElementById("DIV_BOTTOM").innerHTML = req.responseText;
advertisementCheckerNew = "Done";
checkMainInterFaceNew();
myMainCategoryMovingNew();
}
else {
document.getElementById("DIV_BOTTOM").innerHTML = loadPagesImageNew;
}
}
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("");
}
}
function myMainCategoryMovingNew() {
if (catComView.toLowerCase() == "topper") {
findPosYNew(document.getElementById("catBallNew"));
findPosXNew(document.getElementById("catBallNew"));
}
else {
findPosYNew(document.getElementById("catBall"));
findPosXNew(document.getElementById("catBall"));
}
document.getElementById("RelatedProductDiv").style.top = topCategoryNew + 10;
document.getElementById("RelatedProductDiv").style.left = leftCategoryNew + 5;
document.getElementById("FavouriteProductDiv").style.top = topCategoryNew + 10;
document.getElementById("FavouriteProductDiv").style.left = leftCategoryNew + 5;
document.getElementById("leftbartable").style.top = topCategoryNew;
document.getElementById("leftbartable").style.left = leftCategoryNew;
document.getElementById("CompareProductDiv").style.top = topCategoryNew + 10;
document.getElementById("CompareProductDiv").style.left = leftCategoryNew + 5;
}
function renderFavouriteBarNew() {
var xmlRequest = DoCallbackNew(_Domain + "/AJAX/Favourites.aspx", "");
document.getElementById("FavouriteProductDiv").innerHTML = "";
if (xmlRequest.responseText == "Log_error") {
SetSourceNew("Customer/Home.aspx");
document.getElementById("FavouriteProductDiv").innerHTML = "<span class='text13'>Your are not logged In</span>";
}
else {
document.getElementById("FavouriteProductDiv").innerHTML = xmlRequest.responseText;
}
}
function renderHistoryBarNew() {
var xmlRequest = DoCallbackNew("AJAX/History.aspx", "");
document.getElementById("HistoryResult").innerHTML = "";
if (xmlRequest.responseText == "Log_error") {
document.getElementById("HistoryResult").innerHTML = "<span class='text13'>Your are not logged In</span>";
}
else {
document.getElementById("HistoryResult").innerHTML = xmlRequest.responseText;
}
}
function chatroomImageShowNew() {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("POST", "Customer/CustomerChat.aspx", true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
xmlResult = req.responseText;
if (xmlResult != "notLogged In") {
}
}
else {
}
}
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("");
}
}
function ContactInfoNew() {
}
function SelectDefaultLanguageNew() {
if (document.getElementById('select_lang')) {
var _Host = window.location.hostname;
var selectLang = document.getElementById('select_lang');
var s = selectLang.options.length;
for (s; s >= 1; s--) {
var Val = selectLang.options[selectLang.options.length - s].value;
var getHost = Val.split("/");
for (var i = 0; i <= getHost.length; i++) {
if (_Host == getHost[i]) {
selectLang.options[selectLang.options.length - s].selected = true;
}
}
}
}
}
function checkMainInterFaceNew() {
document.getElementById("DIV_LIST").style.visibility = 'hidden';
if ((catloadCheckerNew == "Done") && (advertisementCheckerNew == "Done") && (bannerCheckerNew == "Done")) {
if (catComView == "topper") {
hrMenu_HideAllLayers('level1');
hrMenu_RootLevel(horizontalDefaultCat, 'hrMenuContainer');
document.getElementById("DIV_LIST").style.visibility = 'hidden';
}
else {
document.getElementById("DIV_LIST").style.visibility = 'visible';
}
if (document.getElementById("ProductSearch1_searchtxt").style.visibilty == "visible") {
document.getElementById("ProductSearch1_searchtxt").focus();
}
}
}
function H_MenuControlHeadingNew(cat) {
var currentCat;
currentCat = "?currentCat=" + cat;
var req = null;
req = initXMLHTTPRequestNew();
downLayer = "blank";
if (req) {
req.open("POST", "AJAX/h_Cat_main.aspx" + currentCat, true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
document.getElementById("stackText").innerHTML = "";
document.getElementById("stackText").innerHTML = req.responseText;
h_InitializeNew();
}
else {
document.getElementById("stackText").innerHTML = loadPagesImageNew;
}
}
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("");
}
}
function h_InitializeNew() {
if (dom) {
layer = document.getElementById("h_contectText").getElementsByTagName("table");
layer['h_contectFirst'].style.visibility = "visible";
layer['h_contectFirst'].style.left = 0;
}
else if (ns4) {
layer = "document['h_contectText'].document";
eval(layer + "['h_contectFirst']" + '.visibility = "visible"');
eval(layer + "['h_contectFirst']" + '.left = -15');
}
}
function initXMLHTTPRequestNew() {
var xRequest = null;
if (window.XMLHttpRequest) {
xRequest = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
xRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
return xRequest;
}
function spaceRow() {
}
function SetSourceNew(src) {
getIPhoneIViewForNew("SetSourceNew");
try { RestoreScreenWindow(src); parent.RestoreScreenWindow(src); }
catch (e) { }
if (window.frames["frame_details"] != undefined) {
var catURLForFullView = CateFilesWithResoltuionNew(src)
if (resizeInfiniViewWithResolution == true) {
window.frames["frame_details"].location.replace(catURLForFullView);
} else {
window.frames["frame_details"].location.replace(src);
}
UnLoadCommandsNew();
}
else {
this.location.href = src;
}
}
function downslideNew() {
topLayerHideNew();
document.getElementById("DIV_LIST").style.display = 'none';
if (ns4 || ie4) {
if (block.x < 205) {
block.x += 10
block.left = block.x
setTimeout("downslideNew()", 6)
}
else {
combNew('textbarcol', 'textbarcol2')
}
}
}
function RelatedProductNew(CurrentproId) {
GlobalObjectNew("FavouriteProductDiv").style.display = "none";
GlobalObjectNew("HistoryProductDiv").style.display = "none";
currentRelatedProId = CurrentproId;
var params;
params = "?CurrentProId=" + CurrentproId;
GlobalObjectNew("RelatedProductDiv").innerHTML = frameLoading;
var _RelatedResult;
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("GET", _Domain + "/AJAX/RelatedProduct.aspx" + params, true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
xmlResult = req.responseText;
if (xmlResult == "No Data") {
_RelatedResult = xmlResult;
GlobalObjectNew("RelatedProductDiv").style.display = 'none';
}
else {
GlobalObjectNew("RelatedProductDiv").innerHTML = xmlResult;
_resWizardPro = GlobalObjectNew("RelatedProductDiv").innerHTML;
initArrowNew('reletedProducts');
var lengthArr;
lengthArr = GlobalObjectNew("arrayLength").innerText;
RelatedProductNewLength = new Array(lengthArr);
for (var i = 0; i < lengthArr; i++) {
if (GlobalObjectNew("RelatedCheckBox" + i) != null) {
if (GlobalObjectNew("RelatedCheckBox" + i).checked == true) {
RelatedProductNewLength[i] = GlobalObjectNew("RelatedCheckBox" + i).value;
}
else {
RelatedProductNewLength[i] = null;
}
}
}
}
chkWizard4_RelatedNew(params, _RelatedResult);
}
else {
document.getElementById("RelatedProductDiv").innerHTML = frameLoading;
}
}
req.send("");
}
}
function initArrowNew(layerId) {
try {
var tablename;
if (layerId == "content") {
tablename = "first";
}
else if (layerId == "contentTop") {
tablename = "SecondTop";
}
else if (layerId == "reletedProducts") {
tablename = "relpro";
}
else if (layerId == "searchRes") {
tablename = "srchres";
}
else if (layerId == "MainCatTop") {
tablename = "maincatcontain";
}
else if (layerId == "FavProducts") {
tablename = "FavPro";
}
else if (layerId == "HistoryProducts") {
tablename = "HistoryPro";
}
if (dom) {
if (tablename == "first") {
layer = document.getElementById(layerId).getElementsByTagName("table");
layer[tablename].style.visibility = "visible";
layer[tablename].style.top = 0;
}
else if (tablename == "srchres") {
try {
layer = document.getElementById(layerId).getElementsByTagName("table");
layer[tablename].style.visibility = "visible";
layer[tablename].style.top = 0;
}
catch (ex) { }
}
else if (tablename == "FavPro") {
try {
layer = document.getElementById(layerId).getElementsByTagName("table");
layer[tablename].style.visibility = "visible";
layer[tablename].style.top = 0;
}
catch (ex) { }
}
else if (tablename == "HistoryPro") {
try {
layer = document.getElementById(layerId).getElementsByTagName("table");
layer[tablename].style.visibility = "visible";
layer[tablename].style.top = 0;
}
catch (ex) { }
}
else if (tablename == "relpro") {
layer = document.getElementById(layerId).getElementsByTagName("table");
layer[tablename].style.visibility = "visible";
layer[tablename].style.top = 0;
}
else if (tablename == "maincatcontain") {
layer = document.getElementById(layerId).getElementsByTagName("table");
layer[tablename].style.visibility = "visible";
layer[tablename].style.top = 0;
}
}
else if (ns4) {
layer = "document['content'].document";
eval(layer + "[tablename]" + '.visibility = "visible"');
eval(layer + "[tablename]" + '.top = -15');
}
}
catch (err) {
}
}
function SetObjectSizeNew(object, width, height) {
if (GetUAgent() == "") {
document.getElementById(object).style.width = getDynamicTransformNew("SetObjectSizeNew", width, height)['width'];
document.getElementById(object).style.height = getDynamicTransformNew("SetObjectSizeNew", width, height)['height'];
}
}
function CheckEQuotequeryStringNewNew() {
var Customer = queryStringNew("customer");
var Product = queryStringNew("product");
var Action = queryStringNew("action");
if (Customer != "false" && Product != "false" && Action != "false") {
var request = new XMLHttpRequest();
if (request) {
request.onreadystatechange = function() {
if (request.readyState == 4) {
document.getElementById("DIV_LIST").innerHTML = request.responseText;
document.getElementById("DIV_LIST").style.visibility = 'visible';
SetObjectSize("DIV_LIST", 226, 100);
initArrow('searchRes');
topLayerShowNew();
CurrentProductID = Product;
DisplayEQuoteProduct(CurrentProductID);
}
}
request.open('POST', EQuotePage + "?customer=" + Customer + "&product=" + Product + "&action=" + Action);
request.send("");
}
return true;
}
else {
return false;
}
}
function queryStringNew(key) {
try {
var page = new PageQueryNew(window.location.search);
return unescape(page.getValue(key));
}
catch (ex) {
}
}
function ShowHideProductCommandsNew(type, params, queryString, ProdId, proType) {
relatedPro_ParentID = ProdId;
if (type == "Category") {
UnLoadCommandsNew();
var xmlRequest = DoCallbackNew("Catalog/DisplayWithDetails.aspx", params);
document.getElementById("DIV_LIST").innerHTML = xmlRequest.responseText;
}
if (type == "Product") {
ProAlert = 1;
FavproductId = ProdId;
FavProType = "true"
CurrentProductID = params;
if (proType == "search") {
LoadProductCommandsNew(queryString);
productCmdQuerry = queryString;
if (GetUAgent() != "") {
LoadProductCommands(queryString, true);
}
}
else if (proType == "nosearch") {
productCmdQuerry = queryString;
LoadProductCommandsNew(queryString);
if (GetUAgent() != "") {
LoadProductCommands(queryString, true);
}
}
}
HideBottomPagebannersNew();
}
function DoCallbackNew(url, params) {
var pageUrl = url + params;
var xmlRequest;
try {
xmlRequest = new XMLHttpRequest();
}
catch (e) {
try {
xmlRequest = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlRequest.open("POST", pageUrl, false);
xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlRequest.send("");
return xmlRequest;
}
function UnLoadCommandsNew() {
var ACTIVECOMMANDS = document.getElementById("ACTIVECOMMANDS");
var ACTIVECOMMANDS_TABS = document.getElementById("ACTIVECOMMANDS_TABS");
if (ACTIVECOMMANDS) {
ACTIVECOMMANDS.style.visibility = 'hidden';
ACTIVECOMMANDS.innerHTML = "";
}
if (ACTIVECOMMANDS_TABS) {
ACTIVECOMMANDS_TABS.style.visibility = 'hidden';
ACTIVECOMMANDS_TABS.innerHTML = "";
}
if (CurrentProductID != 0) {
var _document = null;
try {
_document = window.frames["frame_ProductFilesFS"].window.document;
if (_document != null) {
window.frames["frame_ProductFiles"].MediaFiles = null;
window.frames["frame_ProductFiles"].AudioFiles = null;
}
}
catch (err) {
}
}
}
function LoadProductCommandsNew(QueryString) {
document.getElementById("ACTIVECOMMANDS").style.visibility = 'visible';
document.getElementById("ACTIVECOMMANDS").innerHTML = loadPagesImageNewCenter;
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
if (USE_DATABASE_PRODUCTCOMMANDS) {
req.open("GET", _Domain + "/AJAX/ProductCommands.aspx" + QueryString, true);
}
if (USE_FILESYSTEM_PROUDCTCOMMANDS) {
if (WORKFLOW_PRODUCT == true && WORKFLOW_PRODUCT_MANDATORY == 1) {
if (parseInt(WORKFLOW_PARENT_PRODUCT[WORKFLOW_PARENT_PRODUCT.length - 1]) == WORKFLOW_PRODUCT_CURRENT) {
QueryString = QueryString + "&workflow_product=1&mandatory=" + WORKFLOW_PRODUCT_MANDATORY.toString() + "&ForceCommands=true";
}
else {
QueryString = QueryString + "&workflow_product=1&mandatory=" + WORKFLOW_PRODUCT_MANDATORY.toString();
}
req.open("GET", _Domain + "/AJAX/ProductCommandsFS.aspx" + QueryString, true);
}
else if (WORKFLOW_PRODUCT == true && WORKFLOW_PRODUCT_MANDATORY == 0) {
if (parseInt(WORKFLOW_PARENT_PRODUCT[WORKFLOW_PARENT_PRODUCT.length - 1]) == WORKFLOW_PRODUCT_CURRENT) {
QueryString = QueryString + "&workflow_product=1&mandatory=" + WORKFLOW_PRODUCT_MANDATORY.toString() + "&ForceCommands=true";
}
else {
QueryString = QueryString + "&workflow_product=1&mandatory=" + WORKFLOW_PRODUCT_MANDATORY.toString();
}
req.open("GET", _Domain + "/AJAX/ProductCommandsFS.aspx" + QueryString, true);
}
else {
req.open("GET", _Domain + "/AJAX/ProductCommandsFS.aspx" + QueryString, true);
}
}
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
xmlResult = req.responseText;
document.getElementById("ACTIVECOMMANDS").innerHTML = "";
document.getElementById("ACTIVECOMMANDS").innerHTML = xmlResult;
if (USE_DATABASE_PRODUCTCOMMANDS) {
CycleFile();
LoadSlideShowCommands();
}
if (USE_FILESYSTEM_PROUDCTCOMMANDS) {
_ProductCommands = new ProductCommands(CurrentProductID);
var ProductType = document.getElementById("PRODUCT_TYPE");
if (document.getElementById("buybt").innerHTML == "") {
downslidetwo();
}
if (CheckSharedURL == true) {
document.getElementById("SharedURLID").innerHTML = "";
}
if (ProductType != null) {
switch (ProductType.innerHTML) {
case "NORMAL":
if (document.getElementById("WizardType").innerHTML == "CONFIGURE") {
ProductCommands_FileSystem_Init_Configure();
document.getElementById("PriceRow").style.visibility = 'hidden';
}
else {
ProductCommands_FileSystem_Init();
}
break;
case "BUYER":
ProductCommands_FileSystem_Init_Buyer();
break;
case "AP":
ProductCommands_FileSystem_Init2();
break;
case "AP_WITHBUY":
ProductCommands_FileSystem_Init3();
break;
case "HR_PRODUCT":
var ProductCategory = 'HR_PRODUCT';
ProductCommands_FileSystem_Init4(ProductCategory);
break;
case "WORKFLOW_PRODUCT":
ProductCommands_FileSystem_Init5();
break;
case "BOOKING":
ProductCommands_FileSystem_Init_Booking();
break;
}
}
}
}
else {
}
}
req.send("");
}
}
function addJsElementNew() {
var scriptFiles = new Array(0);
if (isIPhone != "") {
scriptFiles[0] = "http://library2.infinishops.com/HttpCombiner.ashx?s=set_js12&t=type/javascript";
scriptFiles[1] = "http://library2.infinishops.com/HttpCombiner.ashx?s=set_js13&t=type/javascript";
AppAutoLogin();
}
else {
scriptFiles[0] = "http://library2.infinishops.com/HttpCombiner.ashx?s=set_js3&t=type/javascript";
}
var scrptLoop;
for (scrptLoop = 0; scrptLoop < scriptFiles.length; scrptLoop++) {
var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement("script");
newScript.type = 'text/javascript';
newScript.src = scriptFiles[scrptLoop];
headID.appendChild(newScript);
}
if (GetUAgent() == '') {
var css = document.createElement("link");
css.setAttribute("href", "../stylesheet/mainstyle.css");
css.setAttribute("rel", "stylesheet");
css.setAttribute("type", "text/css");
document.getElementsByTagName("HEAD")[0].appendChild(css);
}
}
function findPosXNew(obj) {
var curleft = 0;
if (obj.offsetParent) {
while (obj.offsetParent) {
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (obj.x)
curleft += obj.x;
leftCategoryNew = curleft;
return curleft;
}
function findPosYNew(obj) {
var curtop = 0;
if (obj.offsetParent) {
while (obj.offsetParent) {
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
topCategoryNew = curtop;
return curtop;
}
function GetDocumentTitleNew() {
var domain = document.domain;
var words = domain.split('.');
var result = "::.. Welcome to " + words[1] + " ..::";
return result;
}
function setDocumentDomainNew() {
if (fullDomainNameNew == "") {
fullDomainNameNew = document.domain;
}
var domain = document.domain;
document.domain = domain.substring(domain.indexOf('.') + 1);
setCookie();
}
function CateFilesWithResoltuionNew(src) {
var splitSrc, fileName, newPattren, newCatURL, getResoluation;
getResoluation = ValidResoltuionNew()
if ((resizeInfiniViewWithResolution == true) && (src.match(".aspx") == null)) {
splitSrc = src.split("/");
fileName = splitSrc[splitSrc.length - 1];
newPattren = getResoluation + "/" + fileName;
newCatURL = src.replace(fileName, newPattren);
return newCatURL;
}
splitSrc = src.split("/");
fileName = splitSrc[this.length + 1];
newPattren = getResoluation + "/" + fileName;
newCatURL = src.replace(fileName, newPattren);
return newCatURL;
}
function isIPhoneBrowser() {
if (navigator.userAgent.indexOf('iPhone') != -1) {
return true;
}
else {
return false;
}
}
function ValidResoltuionNew() {
if (GetUAgent() != "") {
return "250x250";
}
else {
if (catComView.toLowerCase() == "topper") {
return "855x475";
}
else {
if ((screen.width <= 1023) || (screen.height <= 767)) { return "800x600"; }
else if ((screen.width <= 1279) || (screen.height <= 1023)) { return "1024x768"; }
else { return "1280x1024"; }
}
}
}
function GetBrowserIndependentElementNew(element) {
if (document.getElementById) {
return document.getElementById(element);
}
else if (document.getElementsByName) {
return document.getElementsByName(element);
}
else if (document.layers) {
return document.layers[element];
}
else if (document.all) {
return document.all[element];
}
}
function downslidetwoNew() {
}
function topLayerShowNew() {
if (document.getElementById("topLink").style.visibility == "visible") {
return;
}
else {
document.getElementById("topLink").style.visibility = "visible";
}
}
function PageQueryNew(q) {
if (q.length > 1) this.q = q.substring(1, q.length);
else this.q = null;
this.keyValuePairs = new Array();
if (q) {
for (var i = 0; i < this.q.split("&").length; i++) {
this.keyValuePairs[i] = this.q.split("&")[i];
}
}
this.getKeyValuePairs = function() {
return this.keyValuePairs;
}
this.getValue = function(s) {
for (var j = 0; j < this.keyValuePairs.length; j++) {
if (this.keyValuePairs[j].split("=")[0] == s)
return this.keyValuePairs[j].split("=")[1];
}
return false;
}
this.getParameters = function() {
var a = new Array(this.getLength());
for (var j = 0; j < this.keyValuePairs.length; j++) {
a[j] = this.keyValuePairs[j].split("=")[0];
}
return a;
}
this.getLength = function() { return this.keyValuePairs.length; }
}
function totalPriceRemoverNew() {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("POST", "AJAX/remove_total.aspx", true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
}
else {
}
}
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("");
}
}
function NavigateToProductFromSupportNew(productID) {
var PageName = GetPageNameNew();
if (PageName.toLowerCase() == '/ajax/home.aspx') {
var URL = "http://" + window.location.host + "/default.aspx?ProURL_ID=" + productID;
parent.window.location = URL;
}
else {
document.getElementById("stackText").innerHTML = "";
SetSourceNew("/loadingpage.html");
totalPriceRemoverNew();
var url = "http://" + location.hostname + "/Utility.asmx";
var xmlRequest = RemoteCallWebServiceNew(url, "business4less.com", "ValidProduct", "<ProductID>" + productID.toString() + "</ProductID>");
var xContent = ParseXMLResponse(xmlRequest)
var result = xContent;
if (result == "1") {
downslideNew();
RelatedProductNew(productID);
ShowHideProductCommandsNew('Product', productID, '?product_id=' + productID, productID, 'nosearch');
if (SharedProdId == "") {
productCatLedder(productID);
}
}
}
}
function RemoteCallWebServiceNew(url, ns, method, params) {
var xmlRequest;
xmlRequest = globalAjaxHttpObjectNew();
xmlRequest.open("POST", url, false);
xmlRequest.setRequestHeader("Man", "POST " + url + "HTTP/1.1")
xmlRequest.setRequestHeader("MessageType", "CALL")
xmlRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlRequest.setRequestHeader("SOAPAction", ns + "/" + method);
var sr = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope " +
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +
"xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
"<soap:Body>" +
"<" + method + " xmlns=\"" + ns + "\">" + params + "</" + method + "></soap:Body></soap:Envelope>";
xmlRequest.send(sr);
return xmlRequest;
}
function topLayerHideNew() {
if (document.getElementById("topLink")) {
if (GetUAgent != '') {
if (document.getElementById("topLink").style.visibility == "hidden") {
return;
}
else {
document.getElementById("topLink").style.visibility = "hidden";
}
}
}
}
function combNew(layerhide, layershow) {
if (document.getElementById("textbarcol2")) {
imgoneNew(layerhide);
imgtwoNew(layershow);
document.getElementById("textbarcol2").style.display = 'none'; 	// New Updation for product
document.getElementById("DIV_LIST").style.display = 'none'; 		// New Updation for product
}
}
function imgoneNew(layerhide) {
if (document.getElementById(layerhide)) {
document.getElementById(layerhide).style.display = 'none';
}
}
function imgtwoNew(layershow) {
if (document.getElementById(layershow)) {
document.getElementById(layershow).style.display = 'block';
}
}
function BestOfferBidNew() {
var url = "http://" + window.location.host + "/MP_AJAX/MP_ProductDetails.aspx" + GlobalMpQuery + "&placebid=true";
var xmlRequest = DoCallbackNew(url, "")
if (xmlRequest) {
var str = xmlRequest.responseText;
if (str == 'NOTLOGIN') {
SetSourceNew('/MP_AJAX/MP_bid.aspx' + GlobalMpQuery)
}
else {
PlaceBestOfferBidNew();
}
}
else {
}
}
function PlaceBestOfferBidNew() {
var url = "http://" + window.location.host + "/MP_AJAX/MP_ApprovedSuppiler.aspx" + window.location.search + "&check=supplier";
var xmlRequest = DoCallbackNew(url, "");
if (xmlRequest) {
var str = xmlRequest.responseText;
if (str == 'APPROVED') {
parent.window.location = "http://" + window.location.host + "/Default.aspx" + window.location.search + "&qstr=login";
}
else if (str == 'CONTROLLEDBID') {
downslideNew
SetSourceNew("/loadingpage.html");
RedirectPlaceBidNew()
}
else if (str == 'NOTAPPROVED') {
var url = "http://" + window.location.host + "/MP_AJAX/MP_PlaceBid.aspx" + window.location.search;
parent.SetSourceNew(url)
}
else if (str == 'FIXTENDER') {
SubmitBestOfferBidNew()
}
else if (str == 'FIXBIDDER') {
SubmitBestOfferBidNew()
}
else if (str == 'SELLING') {
PlaceapprovebidNew()
}
else if (str == 'NOTAPPROVEDBIDDER') {
var url = "http://" + window.location.host + "/MP_AJAX/MP_PlaceBid.aspx" + window.location.search;
SetSourceNew(url)
}
else if (str == 'NOTALLOWED') {
var url = "http://" + window.location.host + "/MP_AJAX/MP_PlaceBid.aspx" + window.location.search + "&bidder=NOTALLOWED";
SetSourceNew(url)
}
}
}
function SubmitBestOfferBidNew() {
if (queryStringNew("isfixpricetender") == 'Y') {
var url = "http://" + window.location.host + "/MP_AJAX/MP_PlaceBid.aspx" + window.location.search;
SetSourceNew(url);
}
else if (queryStringNew("type") == 'profile') {
var PQnty = document.getElementById('lbl_quantity').innerText;
var NPrice = document.getElementById('new_offer').value;
var qstring = "new_offer=" + NPrice + "&purchased_quantity=" + PQnty;
var url = "http://" + window.location.host + "/MP_AJAX/MP_CheckBid.aspx" + GlobalMpQuery + "&" + qstring + "&" + "check=" + imp_check + "&base_percentage=" + imp_base_per;
if (fixMoney(document.getElementById('new_offer')) == true) {
var xmlRequest = DoCallbackNew(url, "")
{
var str = xmlRequest.responseText;
var temp = new Array();
temp = str.split('&');
if (queryStringNew("type") == 'profile') {
if (temp[0] == 'false1') {
document.getElementById('err_msg_head').value = "* Please enter";
document.getElementById('err_msg').value = " bid greater than current bid";
}
else if (temp[0] == 'false2') {
document.getElementById('err_msg_head').value = "* You can not ";
document.getElementById('err_msg').value = "place bid greater than " + temp[1];
}
else {
var url = "http://" + window.location.host + "/MP_AJAX/MP_PlaceBid.aspx" + GlobalMpQuery + "&" + qstring + "&" + str;
SetSourceNew(url);
}
}
else {
if (temp[0] == 'false1') {
document.getElementById('err_msg_head').value = "* Please enter";
document.getElementById('err_msg').value = " bid greater than current bid";
}
else if (temp[0] == 'false2') {
document.getElementById('err_msg_head').value = "* You can not ";
document.getElementById('err_msg').value = "place bid greater than " + temp[1];
}
else {
var url = "http://" + window.location.host + "/MP_AJAX/MP_PlaceBid.aspx" + GlobalMpQuery + "&" + qstring + "&" + str;
SetSourceNew(url);
}
}
}
}
}
else if (queryStringNew("type") == 'selling') {
var NPrice = document.getElementById('new_offer').value;
var qstring = "new_offer=" + NPrice; //+"&purchased_quantity="+PQnty;
var url = "http://" + window.location.host + "/MP_AJAX/MP_CheckBid.aspx" + GlobalMpQuery + "&" + qstring + "&" + "check=" + imp_check + "&base_percentage=" + imp_base_per;
if (fixMoney(document.getElementById('new_offer')) == true) {
var xmlRequest = DoCallbackNew(url, "")
{
var str = xmlRequest.responseText;
var temp = new Array();
temp = str.split('&');
if (queryStringNew("type") == 'selling') {
if (temp[0] == 'false1') {
document.getElementById('err_msg_head').value = "* Please enter";
document.getElementById('err_msg').value = " bid greater than current bid";
}
else if (temp[0] == 'false2') {
document.getElementById('err_msg_head').value = "* You can not ";
document.getElementById('err_msg').value = "place bid less than " + temp[1];
}
else {
var url = "http://" + window.location.host + "/MP_AJAX/MP_PlaceBid.aspx" + GlobalMpQuery + "&" + qstring + "&" + str;
SetSourceNew(url);
}
}
}
}
}
else {
var PQnty = document.getElementById('lbl_quantity').innerText;
var NPrice = document.getElementById('new_offer').value;
var qstring = "new_offer=" + NPrice + "&purchased_quantity=" + PQnty;
var url = "http://" + window.location.host + "/MP_AJAX/MP_CheckBid.aspx" + GlobalMpQuery + "&" + qstring + "&" + "check=" + imp_check + "&base_percentage=" + imp_base_per;
if (fixMoney(document.getElementById('new_offer')) == true) {
var xmlRequest = DoCallbackNew(url, "")
{
var str = xmlRequest.responseText;
var temp = new Array();
temp = str.split('&');
if (temp[0] == 'false1') {
document.getElementById('err_msg_head').value = "* Please enter";
document.getElementById('err_msg').value = " bid less than current bid";
}
else if (temp[0] == 'false2') {
document.getElementById('err_msg_head').value = "* You can not ";
document.getElementById('err_msg').value = "place bid less than " + temp[1];
}
else {
var url = "http://" + window.location.host + "/MP_AJAX/MP_PlaceBid.aspx" + GlobalMpQuery + "&" + qstring + "&" + str;
SetSourceNew(url);
}
}
}
}
}
function RedirectPlaceBidNew() {
src = "http://" + window.location.host + "/Specialize/PlaceControllBidBid.aspx" + GlobalMpQuery;
SetSourceNew(src);
}
function chkWizard4_RelatedNew(params, resultRealted) {
if (USE_DATABASE_PRODUCTCOMMANDS) {
if (resultRealted == "No Data") {
document.getElementById("RelatedProductDiv").style.display = 'none';
}
else if (resultRealted != "No Data") {
document.getElementById("RelatedProductDiv").style.display = 'block';
}
}
if (USE_FILESYSTEM_PROUDCTCOMMANDS) {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("GET", "AJAX/PreActivateFileCheck.aspx" + params, true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4)
if (ready == 4) {
xmlResult = req.responseText;
if (xmlResult == "NoWizard," && resultRealted == "No Data") {
document.getElementById("RelatedProductDiv").style.display = 'none';
}
else if (xmlResult == "NoWizard," && resultRealted != "No Data") {
document.getElementById("RelatedProductDiv").style.display = 'block';
}
else if ((xmlResult == "Wizard," || xmlResult == "Wizard,VR") && resultRealted != "No Data") {
_wizardGlobalChk = xmlResult;
_relatedresultchk = resultRealted;
document.getElementById("RelatedProductDiv").style.display = 'block';
}
else if ((xmlResult == "Wizard," || xmlResult == "Wizard,VR") && resultRealted == "No Data") {
_wizardGlobalChk = xmlResult;
_relatedresultchk = resultRealted;
document.getElementById("RelatedProductDiv").style.display = 'none';
}
else if ((xmlResult != "Wizard," || xmlResult != "Wizard,VR") && (resultRealted != "No Data" || resultRealted == "No Data")) {
_wizardGlobalChk = xmlResult;
_relatedresultchk = resultRealted;
document.getElementById("RelatedProductDiv").style.display = 'none';
}
}
}
req.send("");
}
}
}
function fullViewWithURLsNew() {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0].toLowerCase() == "ipcheck") {
IpRedirect = true;
}
}
resizeInfiniViewWithResolution = false;
}
function SetCookie() {
if (arguments.length < 2) { return; }
var n = arguments[0];
var v = arguments[1];
var d = 0;
if (arguments.length > 2) { d = parseInt(arguments[2]); }
var exp = '';
if (d > 0) {
var now = new Date();
then = now.getTime() + (d * 24 * 60 * 60 * 1000);
now.setTime(then);
exp = '; expires=' + now.toGMTString();
}
document.cookie = n + "=" + escape(String(v)) + '; path=/' + exp;
} // function SetCookie()
function ReadCookie(n) {
var cookiecontent = new String();
if (document.cookie.length > 0) {
var cookiename = n + '=';
var cookiebegin = document.cookie.indexOf(cookiename);
var cookieend = 0;
if (cookiebegin > -1) {
cookiebegin += cookiename.length;
cookieend = document.cookie.indexOf(";", cookiebegin);
if (cookieend < cookiebegin) {
cookieend = document.cookie.length;
}
cookiecontent = document.cookie.substring(cookiebegin, cookieend);
}
}
return unescape(cookiecontent);
} // function ReadCookie()
function setCookie() {
var acookie = ReadCookie("infiniCookie");
return Parser(acookie);
}
function Parser(str) {
var parseCookie = new String(str)
if (parseCookie != "") {
var splitCookie = parseCookie.split("=");
var parseUserId = splitCookie[1].split("&");
var parseJabberId = splitCookie[3]
var visterID = parseUserId[0];
postURL(visterID)
}
}
function postURL(visiterId) {
var tempurl, tempStr, strLth;
var newlth;
tempurl = document.location.href;
tempurl = tempurl.substring(7, tempurl.length);
var tempStr = tempurl.split("/");
var value = window.location.protocol + "//" + window.location.host + "/tracker/tracker.aspx?referrer=" + escape(document.referrer);
var docLocation = document.location.href;
value += "&customerId=" + visiterId;
if (readJabberCookie("InfiniCustomerJabberId") != null) {
docLocation += "&customerId=" + visiterId + "&customerJID=" +
readJabberCookie("InfiniCustomerJabberId") + "&operatorJID=" +
readJabberCookie("InfiniCustomerOpreatorId");
}
value += "&location=" + escape(docLocation);
var html_doc = document.getElementsByTagName("head").item(0);
var scriptTag = document.createElement("SCRIPT");
scriptTag.src = value;
html_doc.appendChild(scriptTag);
}
function getJID(JID, operatorJID) {
createJabberCookie("InfiniCustomerJabberId", JID, 7)
createJabberCookie("InfiniCustomerOpreatorId", operatorJID, 7)
setCookie();
}
function createJabberCookie(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 readJabberCookie(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 ParseXMLResponse(request) {
var xmlDoc;
if (isIE() == true) {
xmlDoc = request.responseXML
return xmlDoc.text;
}
else {
parser = new DOMParser();
xmlDoc = parser.parseFromString(request.responseText, "text/xml");
return xmlDoc.firstChild.textContent;
}
}
function isIE() {
if (navigator.appName == "Microsoft Internet Explorer") {
return true;
} else {
return false;
}
}
function globalAjaxHttpObjectNew() {
var xmlRequest;
try {
xmlRequest = new XMLHttpRequest();
return xmlRequest;
}
catch (e) {
try {
xmlRequest = new ActiveXObject("Msxml2.XMLHTTP");
return xmlRequest;
}
catch (e) {
try {
reqVar = new ActiveXObject("Microsoft.XMLHTTP");
return xmlRequest;
}
catch (e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
}
function DirectCategoryOpen(CatID, DirectCatType) {
if (catComView != "topper") {
if (CatID > 0) {
if (GetUAgent != "") {
document.getElementById("RelatedProductDiv").style.display = 'none';
nullAllVar();
if (DirectCatType) {
SetIframeMenuSrc(CatID, '', DirectCatType);
}
else {
SetIframeMenuSrc(CatID);
}
}
else {
var xmlResult;
var xmlRequest = DoCallback(_Domain + "/resultCate.aspx?catid=", CatID);
xmlResult = xmlRequest.responseText;
hideFavRight();
hideHistoryRight();
document.getElementById("RelatedProductDiv").style.display = 'none';
FrameSize('');
topLayerShow();
nullAllVar();
LoadChildren1('Category', xmlResult, 'javascript:');
slidebox('slidebox1');
textbar('textbarcol');
parentStacking(CatID);
}
}
}
}
function DirectCategoryOpenByType(CatType) {
try {
if (CatType.replace(/^\s+|\s+$/, "") != "") {
SetIframeMenuSrc(null, null, CatType);
}
} catch (ex) {
alert("Function: DirectCategoryOpenByType()  " + ex);
}
}
function RedirectToCategoryNew(outsider) {
if (outsider > 0) {
location.href = "../default.aspx?CategoryID=" + outsider;
}
}
function catImageChange(catId, imageUrl, status, catPathId) {
if (status == "hover") {
if (_mainCateId != null) {
_mainCateId.src = '../cat_files/' + _mainCatImage + '/cat_textImg/simple.gif';
_mainCateId = null;
}
else {
catId.src = imageUrl;
_mainCateId = catId;
}
_mainCatImage = catPathId;
}
}
function CouponTicket(Orderid, MerchantID, CustomerID, EmailAddress, EmailType, ProductName) {
var url = "http://" + top.window.location.host + "/shopping/CouponRedirection.aspx?OrderId=" + Orderid + "&MerchantID=" + MerchantID + "&CustomerID=" + CustomerID + "&ProductName=" + ProductName + "&EmailType=" + EmailType + "&EmailAddress='" + EmailAddress + "'";
var xmlRequest = DoCallbackNew(url, "")
if (xmlRequest) {
alert("Email Has Been Successfully Sent");
}
}
function PageBannerLoad(screen, Banner, slot) {
var url = _Domain + "/MP_Ajax/MP_PageBanner.aspx?slot_name=" + slot + "&screen=" + screen + "&banner=" + Banner;
var xmlRequest = DoCallbackNew(url, "")
if (xmlRequest) {
if (Banner == 'Banner_right') {
document.getElementById("Banner_right").style.display = "block";
PageAdRender(xmlRequest.responseText, 'Banner_right')
}
else if (Banner == 'Banner_left') {
document.getElementById("Banner_left").style.display = "block";
PageAdRender(xmlRequest.responseText, 'Banner_left')
}
else if (Banner == 'Banner_bottom') {
document.getElementById("Banner_bottom").style.display = "block";
PageAdRender(xmlRequest.responseText, 'Banner_bottom')
}
}
}
var temp_right = new Array();
var temp_left = new Array();
var temp_bottom = new Array();
function PageAdRender(res, banner) {
var str = res;
if (banner == 'Banner_right') {
temp_right = str.split('&&');
PageAd();
var ints1;
ints = setInterval("PageAd();", 30000)
}
else if (banner == 'Banner_left') {
temp_left = str.split('&&');
PageAdleft();
var ints2;
ints = setInterval("PageAdleft();", 30000)
}
else if (banner == 'Banner_bottom') {
temp_bottom = str.split('&&');
PageAdbottom();
var ints3;
ints = setInterval("PageAdbottom();", 30000)
}
}
var count = 0
function PageAd() {
if (temp_right[count] != null) {
if (temp_right[count] != '') {
document.getElementById("Banner_right").style.display = "block";
document.getElementById("Banner_right").innerHTML = temp_right[count];
count = count + 1;
}
else {
count = 0
}
}
else {
document.getElementById("Banner_right").style.display = "block";
count = 0
}
}
var count1 = 0
function PageAdleft() {
if (temp_left[count1] != null) {
if (temp_left[count1] != '') {
document.getElementById("Banner_left").style.display = "block";
document.getElementById("Banner_left").innerHTML = temp_left[count1];
count1 = count1 + 1;
}
else {
count1 = 0
}
}
else {
document.getElementById("Banner_left").style.display = "block";
count1 = 0
}
}
var count2 = 0
function PageAdbottom() {
if (temp_bottom[count2] != null) {
if (temp_bottom[count2] != '') {
document.getElementById("Banner_bottom").style.display = "block";
document.getElementById("Banner_bottom").innerHTML = temp_bottom[count2];
count2 = count2 + 1;
}
else {
count2 = 0
}
}
else {
document.getElementById("Banner_bottom").style.display = "block";
count2 = 0
}
}
function SetSourceNewWithCommands(src) {
getIPhoneIViewForNew("SetSourceNewWithCommands");
if (USE_FILESYSTEM_PROUDCTCOMMANDS) {
_screenWidthChkr = screen.width;
if (_screenWidthChkr >= 1280) {
src = src.replace("resolution", "1280x1024")
window.frames["frame_details"].location.replace(src);
fullScreenIframeSrc = src;
}
else if (_screenWidthChkr >= 1024 && _screenWidthChkr < 1280) {
src = src.replace("resolution", "1024x768")
window.frames["frame_details"].location.replace(src);
fullScreenIframeSrc = src;
}
else if (_screenWidthChkr >= 800 && _screenWidthChkr < 1024) {
src = src.replace("resolution", "800x600")
window.frames["frame_details"].location.replace(src);
fullScreenIframeSrc = src;
}
else {
window.frames["frame_details"].location.replace(src);
fullScreenIframeSrc = src;
}
}
else {
window.frames["frame_details"].location.replace(src);
return;
}
}
function ProfileBidNew() {
var url = "http://" + window.location.host + "/MP_AJAX/MP_ProductDetails.aspx" + GlobalMpQuery + "&placebid=true";
var xmlRequest = DoCallbackNew(url, "")
if (xmlRequest) {
var str = xmlRequest.responseText;
if (str == 'NOTLOGIN') {
SetSourceNew('/MP_AJAX/MP_Profiler.aspx' + GlobalMpQuery)
}
else {
PlaceProfileBidNew();
}
}
}
function PlaceProfileBidNew() {
var url = "http://" + window.location.host + "/MP_AJAX/MP_ApprovedSuppiler.aspx" + window.location.search + "&check=supplier";
var xmlRequest = DoCallbackNew(url, "")
if (xmlRequest) {
var str = xmlRequest.responseText;
if (str == 'APPROVED') {
parent.window.location = "http://" + window.location.host + "/Default.aspx" + window.location.search + "&qstr=login";
}
else if (str == 'CONTROLLEDBID') {
downslideNew();
RedirectPlaceBidNew();
}
else if (str == 'NOTAPPROVED') {
var url = "http://" + window.location.host + "/MP_AJAX/MP_PlaceBid.aspx" + window.location.search;
SetSourceNew(url)
}
else if (str == 'FIXTENDER') {
SubmitBestOfferBidNew();
}
}
else {
}
}
function DirectConvenceMeNew() {
if (Filetype == "2" && Typestepno != "") {
_ProductCommands.LoadConvinceMeFiles();
}
}
function ControlOption() {
findPosYNew(document.getElementById("OptionCont"));
findPosXNew(document.getElementById("OptionCont"));
document.getElementById("OptionControl").style.top = topCategoryNew + 25;
document.getElementById("OptionControl").style.left = leftCategoryNew - 180;
document.getElementById("OptionControl").style.display = "Block";
document.getElementById("OptionControl").innerHTML = loadPagesImageNew;
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("POST", "AJAX/ControlPanel.aspx", true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
document.getElementById("OptionControl").innerHTML = req.responseText;
}
else {
document.getElementById("OptionControl").innerHTML = loadPagesImageNew;
}
}
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("");
}
}
function CloseControlPanel() {
document.getElementById("OptionControl").style.display = "none";
document.getElementById("preferences").src = "images/preferences.jpg";
}
function ControlValueChange(CookieType) {
var query = '?Cookietype=' + CookieType;
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("POST", "AJAX/ControlPanelValueChange.aspx" + query, true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
document.getElementById(CookieType).innerHTML = req.responseText;
}
else {
document.getElementById(CookieType).innerHTML = loadPagesImageNewCenterNew;
}
}
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("");
}
}
function ControlValueChangeRefresh(CookieType) {
var query = '?Cookietype=' + CookieType;
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("POST", "AJAX/ControlPanelValueChange.aspx" + query, true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
document.getElementById('loading').innerHTML = "";
parent.document.execCommand('Refresh');
}
else {
document.getElementById('loading').innerHTML = loadPagesImageNewCenterNew;
}
}
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("");
}
}
function FrameSizeOld(size) {
if (catComView.toLowerCase() == "topper") {
var screen_height = screen.height;
var screen_width = screen.width;
var IFrame = document.getElementById("frame_details");
var MainTable = document.getElementById("Page_Table");
if ((screen_width <= 1023) || (screen_height <= 767)) {
if (size.toLowerCase() == 'large') {
document.getElementById("fullframeNew").style.display = 'none';
document.getElementById("leftbartable").style.display = "none";
IFrame.width = "772";
IFrame.height = "355"
}
else {
document.getElementById("fullframeNew").style.display = 'block';
IFrame.width = "546";
IFrame.height = "314"
}
}
else if ((screen_width <= 1279) || (screen_height <= 1023)) {
if (resizeInfiniViewWithResolution == false) {
if (size.toLowerCase() == 'large') {
document.getElementById("fullframeNew").style.display = 'none';
document.getElementById("leftbartable").style.display = "none";
IFrame.width = "772";
IFrame.height = "355"
}
else {
document.getElementById("fullframeNew").style.display = 'block';
IFrame.width = "546";
IFrame.height = "314"
}
}
else {
if (size.toLowerCase() == 'large') {
document.getElementById("fullframeNew").style.display = 'none';
document.getElementById("leftbartable").style.display = "none";
document.getElementById("catBall").style.width = '0px';
IFrame.width = "970";
IFrame.height = "356";
}
else {
document.getElementById("fullframeNew").style.display = 'block';
document.getElementById("catBall").style.width = '250px';
IFrame.width = "768"
IFrame.height = "314";
}
}
}
else if ((screen_width >= 1280) || (screen_height >= 1024)) {
if (resizeInfiniViewWithResolution == false) {
if (size.toLowerCase() == 'large') {
document.getElementById("fullframeNew").style.display = 'none';
document.getElementById("leftbartable").style.display = "none";
IFrame.width = "780";
IFrame.height = "355"
}
else {
document.getElementById("fullframeNew").style.display = 'block';
IFrame.width = "546";
IFrame.height = "314"
}
}
else {
if (size.toLowerCase() == 'large') {
document.getElementById("fullframeNew").style.display = 'none';
document.getElementById("leftbartable").style.display = "none";
IFrame.width = "1205";
IFrame.height = "597";
}
else {
document.getElementById("fullframeNew").style.display = 'block';
IFrame.width = "960";
IFrame.height = "477";
}
}
}
}
}
function NavigateToThanks(Desc) {
SetSourceNew('../thanks.aspx?description=' + Desc);
}
function PlaceapprovebidNew() {
var url = "http://" + window.location.host + "/MP_AJAX/displayDescription.aspx" + GlobalMpQuery + "&checkBanner=true&_screen=" + screen.width;
var xmlRequest = DoCallbackNew(url, "");
if (xmlRequest) {
var str = xmlRequest.responseText;
if (str == 'ok') {
var merchant_id = queryStringNew("merchant_product_id");
src = '../ProductFiles/' + merchant_id + '/1/1/resolution/index.htm';
SetSourceWithCommandsNew(src);
}
else {
SetSourceWithCommandsNew("http://" + window.location.host + "/MP_AJAX/displayDescription.aspx" + GlobalMpQuery);
}
}
var url = "http://" + window.location.host + "/MP_AJAX/MP_ProductDetails.aspx" + window.location.search + "&qstr=login";
var xmlRequest = DoCallbackNew(url, "")
if (xmlRequest) {
document.getElementById('ACTIVECOMMANDS').style.visibility = 'visible';
document.getElementById('ACTIVECOMMANDS').innerHTML = xmlRequest.responseText;
}
}
function OpenCategoryProduct(productID) {
if ((productID.toLowerCase()) != 'nothing') {
CheckSharedURL = true;
totalPriceRemoverNew();
var url = "http://" + location.hostname + "/Utility.asmx";
var xmlRequest = RemoteCallWebServiceNew(url, "business4less.com", "ValidProduct", "<ProductID>" + productID.toString() + "</ProductID>");
var xContent = ParseXMLResponse(xmlRequest)
var result = xContent;
if (result == "1") {
ShowHideProductCommandsNew('Product', productID, '?product_id=' + productID, productID, 'nosearch');
}
}
}
function CheckBottombannerNew() {
if (document.getElementById("ACTIVECOMMANDS").innerHTML != "") {
document.getElementById("BottomBannerTD").style.display = "none";
}
else {
document.getElementById("BottomBannerTD").style.display = "block";
}
}
function HidebuttonandChat() {
document.getElementById("BottomBannerTD").style.display = "block";
document.getElementById("btd").style.display = "none";
document.getElementById("sup").style.visibility = "visible";
document.getElementById("cht").style.display = "none";
}
function HideBottomPagebannersNew() {
GlobalObjectNew('BottomBannerTD').style.display = "none";
}
function FrameSetDefault() {
}
function LeftBannerLoad() {
var LeftBannerSource = 'http://' + window.location.host + '/Images_Private/Banners/BannerLeft.htm';
var BannerLeft = document.getElementById('Banner_left'); //window.frames["Banner_left"];
var LeftxmlRequest = DoCallbackNewSecond(LeftBannerSource, "")
if (LeftxmlRequest) {
var Leftstr = LeftxmlRequest.responseText;
if (Leftstr != '') {
BannerLeft.innerHTML = Leftstr;
}
}
}
function RightBannerLoad() {
var RightBannerSource = 'http://' + window.location.host + '/Images_Private/Banners/BannerRight.htm';
var BannerRight = document.getElementById('Banner_right'); //window.frames["Banner_right"];
var RightxmlRequest = DoCallbackNewSecond(RightBannerSource, "")
if (RightxmlRequest) {
var Rightstr = RightxmlRequest.responseText;
if (Rightstr != '') {
BannerRight.innerHTML = Rightstr;
}
}
}
function BottomBannerLoad() {
var BottomBannerSource = 'http://' + window.location.host + '/Images_Private/Banners/BannerBottom.htm';
var BannerBottom = document.getElementById('Banner_bottom'); // window.frames["Banner_right"];
var BottomxmlRequest = DoCallbackNewSecond(BottomBannerSource, "")
if (BottomxmlRequest) {
var Bottomstr = BottomxmlRequest.responseText;
if (Bottomstr != '') {
BannerBottom.innerHTML = Bottomstr;
}
}
}
function DoCallbackNewSecond(url, params) {
var pageUrl = url + params;
var xmlRequest;
try {
xmlRequest = new XMLHttpRequest();
}
catch (e) {
try {
xmlRequest = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlRequest.open("GET", pageUrl, false);
xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlRequest.send("");
return xmlRequest;
}
function MP_ProductAd() {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("GET", "../MP_AJAX/MP_ProductAdvertisement.aspx", true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
document.getElementById('CAuction').innerHTML = req.responseText;
}
}
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("");
}
}
function MP_ProductAdTender() {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("GET", "../MP_AJAX/MP_ProductAdvertisementTender.aspx", true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
document.getElementById('CTender').innerHTML = req.responseText;
}
}
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("");
}
}
function AddScriptFiles() {
if (window.location.search.length <= 0 || IpRedirect == true) {
setTimeout('addJsElementNew()', 1000);
}
}
function ScrollMPProduct() {
var xmlRequest = DoCallbackNew(_Domain + "/MP_AJAX/MP_Advertisement.aspx?checkAd=true", "");
var str = xmlRequest.responseText;
var temp = new Array();
temp = str.split(',');
for (var i = 0; i < temp.length; i++) {
if (temp[i] == 1) {
setTimeout("AE.widget.SimpleScroll.decorate('Auction', {lineHeight: 12, startDelay: 1});", 30000);
}
if (temp[i] == 2) {
setTimeout("AE.widget.SimpleScroll.decorate('Tender', {lineHeight: 12, startDelay: 1});", 30000);
}
if (temp[i] == 3) {
}
}
}
function AllMainFucntion() {
if (window.location.search.length > 0 && IpRedirect == false && window.location.search.toLowerCase() != "?noheader=1") {
setTimeout('CatLoadCallerNew();', 2000);
DirectConvenceMeNew();
}
}
function MP_AdvertisementCall() {
var xmlRequest = DoCallbackNew(_Domain + "/MP_AJAX/MP_Advertisement.aspx?checkAd=true", "");
var str = xmlRequest.responseText;
var temp = new Array();
temp = str.split(',');
for (var i = 0; i < temp.length; i++) {
if (temp[i] == 1) {
MP_ProductAdAuction();
}
if (temp[i] == 2) {
MP_ProductAdTender();
}
if (temp[i] == 3) {
}
}
}
function CheckWorkflowQueryStringNew() {
var Workflow = queryStringNew("Workflow");
var Order = queryStringNew("Order");
var Code = queryStringNew("Code");
var Display = queryStringNew("Display");
if (Workflow != "false" && Order != "false" && Code != "false" && Display != "false") {
if (parent.RedirectedToWorkflowOrder == null) {
RedirectedToWorkflowOrder = true;
var url = PAGE_WORKFLOWORDER + "?Workflow=" + Workflow + "&Order=" + Order + "&Code=" + Code + "&Display=" + Display
SetSourceNew(url);
return true;
}
}
else {
return false;
}
}
function OpencategoryUrl(URL) {
if (URL.toLowerCase() != 'javascript:') {
parent.window.location = URL;
}
}
function GetPageNameNew() {
var sPath = window.location.pathname;
return sPath;
}
function SetBOMCart(src) {
top.parent.SetSourceNew(src);
top.parent.HideBottomPagebannersNew();
var xmlRequest = DoCallbackNew(_Domain + "/AJAX/CartCommands.aspx", "");
top.parent.document.getElementById("ACTIVECOMMANDS").innerHTML = "";
top.parent.document.getElementById("ACTIVECOMMANDS").style.visibility = 'visible';
top.parent.document.getElementById("ACTIVECOMMANDS").innerHTML = xmlRequest.responseText;
top.parent.ShowCartButton();
}
function SetIOBOMCart(src) {
window.frames["frame_details"].location.replace(src);
}
function SetConfigureWizard(src) {
var SrcNew = "http://" + window.location.host + "/" + src
parent.window.frames["IFWizardDetail"].location.replace(SrcNew);
top.document.getElementById('BottomBannerTD').style.display = "none";
var xmlRequest = DoCallbackNew(_Domain + "/AJAX/CartCommands.aspx", "");
parent.document.getElementById("ACTIVECOMMANDS").innerHTML = "";
parent.document.getElementById("ACTIVECOMMANDS").style.visibility = 'visible';
parent.document.getElementById("ACTIVECOMMANDS").innerHTML = xmlRequest.responseText;
}
function getDynamicTransformNew(funcName, dw, dh) {
var sizeOf = new Array();
switch (funcName) {
case "SetObjectSizeNew":
if (GetUAgent() != "") {
sizeOf["width"] = (document.body.clientWidth * .9); //"100%";
sizeOf["height"] = "302";
}
else {
sizeOf["width"] = dw;
sizeOf["height"] = dh;
}
return sizeOf;
break;
}
}
function PreviewShow(Src, func) {
var ImagePreviewSetNew = 'false';
var USettings = ReadCookie("usersettings");
if (USettings != '') {
var varsnew = USettings.split("&");
for (var i = 0; i < varsnew.length; i++) {
var pairnew = varsnew[i].split("=");
if (pairnew[0].toLowerCase() == "productimagepreview") {
ImagePreviewSetNew = pairnew[1];
}
}
}
if (ImagePreviewSetNew.toLowerCase() == 'true' || catComView.toLowerCase() == "topper") {
if (func.toLowerCase() == 'sw') {
SetSourceWithCommandsNew(Src);
}
else if (func.toLowerCase() == 'ss') {
SetSourceNew(Src);
}
}
}
function setTemplateImage(src) {
}
function myaccount() {
}
var h = 20;
var w = 250;
var eH = 50;
var eW = 825;
var sH = 248;
var eSH = 480;
var redirectToInfinishopsURL = null;
function NewPopupShow_Close() {
var divBG = document.getElementById('FilePreviewBg').style;
divBG.display = 'none';
var divSlideShow = document.getElementById('FileProShow').style;
divSlideShow.width = "250";
divSlideShow.height = "0";
divSlideShow.display = 'none';
var tblFileproduct = document.getElementById('tbl_Fileproductprivew').style;
tblFileproduct.width = "825"
tblFileproduct.height = "";
parent.parent.document.getElementById('tdDescription').style.display = 'block';
CouponWindow = false;
var frm_FileProSlideShow = document.getElementById('frm_FileProSlideShow');
frm_FileProSlideShow.width = "580";
frm_FileProSlideShow.height = "340"
document.getElementById("td1_TableBody").style.height = "20";
document.getElementById("td2_TableBody").style.height = "15";
if (tblDate_bgcolor != undefined) { document.getElementById("FileProShow").style.backgroundColor = tblDate_bgcolor; }
}
function NewPopupShow(URL, PProcess) {
if (GetUAgent() == "") {
if (document.getElementById('FilePreviewBg')) {
var ACinnerhtml = "<p><a href='http://www.visaeurope.com/personal/onlineshopping/verifiedbyvisa/main.jsp' target='_blank'><img id='img1' src='../Shared_Images/visa.jpg' border='0'></a></p><p><a href='http://www.mastercard.com/uk/personal/en/cardholderservices/securecode/index.html' target='_blank'><img  id='img2' src='../Shared_Images/mc_securecode.jpg' border='0'></a></p><p><IMG SRC='../Shared_Images/ssl_banner.gif'/></p>";
var PPinnerhtml = "<p><a href='#' onClick=javascript:window.open('" + "https://www.paypal.com/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside" + "'," + "'" + "olcwhatispaypal" + "'," + "'" + "toolbar=no" + "," + "location=no" + "," + "directories=no" + "," + "status=no" + "," + "menubar=no" + "," + "scrollbars=yes" + "," + "resizable=yes" + "," + "width=400" + "," + "height=350" + "'" + ");><img  src='https://www.paypal.com/en_US/i/bnr/vertical_solution_PPeCheck.gif' border='0' alt='Solution Graphics'></a></p><p><IMG SRC='../Shared_Images/ssl_banner.gif'/></p>";
var divBG = document.getElementById('FilePreviewBg').style;
var divSlideShow = document.getElementById('FileProShow').style;
var Body_Height = document.body.scrollHeight;
var Body_Width = document.body.scrollWidth;
if (PProcess != undefined) // in case paypal isnt available for the that merchant, next line will create an error
{
if (PProcess.toLowerCase() == 'pp') {
document.getElementById('PaymentProcessIcon').innerHTML = PPinnerhtml;
}
else {
if (document.getElementById('PaymentProcessIcon')) // remove this line, u need to add that ElementId in the html version of infinishops sites.
{
document.getElementById('PaymentProcessIcon').innerHTML = ACinnerhtml;
}
}
}
redirectToInfinishopsURL = null;
document.getElementById('frm_FileProSlideShow').src = window.location.protocol + "//" + window.location.host + "/loadingpage.html";
redirectToInfinishopsURL = URL;
if (BrowserDetect.browser == "Explorer") {
divSlideShow.top = "9%"
divSlideShow.left = "23%"
}
else if (BrowserDetect.browser == "Safari") {
divSlideShow.top = "20%";
divSlideShow.left = "100%";
}
else if (BrowserDetect.browser == "Firefox") {
divSlideShow.top = "5%";
divSlideShow.left = "7%";
}
else if (BrowserDetect.browser == "Opera") {
divSlideShow.top = "15%";
divSlideShow.left = "35%";
}
else {
divSlideShow.top = "20%";
divSlideShow.left = "100%";
}
divSlideShow.height = "20";
divSlideShow.width = "250";
divBG.height = Body_Height;
divBG.width = Body_Width;
divBG.display = 'block';
document.getElementById('tbl_Fileproductprivew').style.display = 'none';
setTimeout("SlideShow_ImageContainerNew('FileProShow')", 500);
}
else {
try {
parent.document.getElementById('frame_details').src = URL;
}
catch (e) {
document.getElementById('frame_details').src = URL;
}
}
}
else {
try {
parent.document.getElementById('frame_details').src = URL;
}
catch (e) {
document.getElementById('frame_details').src = URL;
}
}
}
function NewPopupShow_Coupon(URL, PProcess) {
CouponWindow = true;
if (GetUAgent() == "") {
if (document.getElementById('FilePreviewBg')) {
var divBG = document.getElementById('FilePreviewBg').style;
var divSlideShow = document.getElementById('FileProShow').style;
var Body_Height = document.body.scrollHeight;
var Body_Width = document.body.scrollWidth;
redirectToInfinishopsURL = null;
document.getElementById('frm_FileProSlideShow').src = "http://" + window.location.host + "/loadingpage.html";
redirectToInfinishopsURL = URL;
if (BrowserDetect.browser == "Explorer") {
divSlideShow.top = "220";
divSlideShow.left = "300";
}
else if (BrowserDetect.browser == "Safari") {
divSlideShow.top = "220";
divSlideShow.left = "300";
}
else if (BrowserDetect.browser == "Firefox") {
divSlideShow.top = "220";
divSlideShow.left = "337";
var tblDate = document.getElementById("FileProShow");
if (tblDate != undefined) {
tblDate_bgcolor = tblDate.style.backgroundColor;
tblDate.style.backgroundColor = "Transparent";
}
}
else if (BrowserDetect.browser == "Mozilla") {
divSlideShow.top = "220";
divSlideShow.left = "300";
}
else {
divSlideShow.top = "30%";
divSlideShow.left = "200";
}
divSlideShow.height = "10";
divSlideShow.width = "50";
divBG.height = Body_Height;
divBG.width = Body_Width;
divBG.display = 'block';
document.getElementById('tbl_Fileproductprivew').style.display = 'none';
setTimeout("SlideShow_ImageContainerNew('FileProShow')", 500);
}
else {
try {
parent.document.getElementById('frame_details').src = URL;
}
catch (e) {
document.getElementById('frame_details').src = URL;
}
}
}
else {
try {
parent.document.getElementById('frame_details').src = URL;
}
catch (e) {
document.getElementById('frame_details').src = URL;
}
}
document.getElementById("tdDescription").style.display = "none";
var tblFileproduct = document.getElementById('tbl_Fileproductprivew').style;
tblFileproduct.width = "0px"
tblFileproduct.height = "0px"
var frm_FileProSlideShow = document.getElementById('frm_FileProSlideShow');
frm_FileProSlideShow.width = "380";
frm_FileProSlideShow.height = "228"
document.getElementById("td1_TableBody").style.height = "0";
document.getElementById("td2_TableBody").style.height = "0";
}
function SlideShow_ImageContainerNew(id) {
var divContainer = document.getElementById(id).style;
divContainer.display = 'block';
setTimeout("SlideShow_ContainerHeightNew('" + id + "')", 500);
}
function SlideShow_ContainerHeightNew(id) {
var eH = 200;
var elem = document.getElementById(id).style;
if (h < eH) {
h += 20;
elem.height = h + "px";
SlideShow_ContainerTopPosNew(id);
setTimeout("SlideShow_ContainerHeightNew('" + id + "')", 10);
}
else {
h = 200;
setTimeout("SlideShow_ContainerWidthNew('" + id + "')", 200);
}
}
function SlideShow_ContainerTopPosNew(id) {
var elem = document.getElementById(id).style;
elem.posTop = elem.posTop - 1;
}
function SlideShow_ContainerWidthNew(id) {
var eW = 625;
if (CouponWindow == true) { eW = 125; }
var elem = document.getElementById(id).style;
if (w < eW) {
w += 20;
elem.width = w + "px";
setTimeout("SlideShow_ContainerWidthNew('" + id + "' )", 10);
SlideShow_ContainerLeftPosNew(id);
}
else {
w = 250;
document.getElementById('frm_FileProSlideShow').src = "";
document.getElementById('frm_FileProSlideShow').src = redirectToInfinishopsURL;
document.getElementById('tbl_Fileproductprivew').style.display = 'block';
}
}
function SlideShow_ContainerLeftPosNew(id) {
var elem = document.getElementById(id).style;
elem.posLeft = elem.posLeft - 1;
}
var milisec = 0;
var seconds = 60;
function displayCounter() {
if (milisec <= 0) {
milisec = 9
seconds -= 1
}
if (seconds <= -1) {
milisec = 0
seconds += 1
seconds = 60
displayCounter();
}
else {
milisec -= 1
if (document.getElementById('d2') != null) {
document.getElementById('d2').value = seconds; //+"."+milisec
}
setTimeout("displayCounter();", 100)
}
}
function thanksdescripion() {
if (window.location.search.length > 0) {
var query_new = window.location.search.substring(1);
var vars = query_new.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0].toLowerCase() == "description") {
if (pair[1] != 'undefined') {
var NewURL = pair[1];
var patt1 = /\+/g;
NewURL = NewURL.replace(patt1, ' ');
document.getElementById("text").innerHTML = unescape(NewURL.replace("BREAK", "<br/>"));
}
}
}
}
}
function WorldWideSiteRedirection(Domain) {
var redirectURL = Domain + '/Default.aspx?ipcheck=no';
var cookie_name = "WorldWideSite";
var dt = new Date();
dt.setFullYear(eval(dt.getYear() + 5));
if (document.cookie) {
index = document.cookie.indexOf(cookie_name);
} else {
index = -1; 1
}
if (index == -1) {
document.cookie = cookie_name + "=" + redirectURL + "; expires=Wednesday, 01-Aug-2040 08:00:00 GMT";
} else {
document.cookie = cookie_name + "=" + redirectURL + "; expires=Wednesday, 01-Aug-" + eval(dt.getYear() + 5) + " 08:00:00 GMT";
}
top.parent.window.location = redirectURL;
}
function RedirectToActivitationProduct(domain, arg, Pid) {
try {
var CName = document.getElementById("companyName").value;
var RedirectURL = 'http://' + domain + '/default.aspx?ptype=' + arg + '&CFname=' + escape(CName) + '&directSearchProductId=' + Pid;
document.getElementById('redirectlink').href = RedirectURL;
}
catch (ex) {
}
}
function SearchCompany() {
try {
if (ptype != "" && CFname != "") {
hideFavRight();
hideHistoryRight();
HideBottomPagebannersNew();
_ProductCommands = new ProductCommands(CurrentProductID);
_ProductCommands.LoadWizard_ForActivationProduct();
ptype = "";
CFname = "";
}
}
catch (ex) {
}
}
function MP_ProductAdAuction() {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("GET", "../MP_AJAX/MP_ProductAdvertisementAuction.aspx", true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
if (document.getElementById('CDailyAuction')) {
document.getElementById('CDailyAuction').innerHTML = req.responseText;
}
}
}
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("");
}
}
function FrameSize(size) {
if (catComView) {
if (catComView.toLowerCase() == "topper") {
var IFrame = document.getElementById("frame_details");
var MainTable = document.getElementById("Page_Table");
document.getElementById("Banner_left_container").style.display = "none";
document.getElementById("Banner_bottom_container").style.display = "none";
document.getElementById("Banner_right_container").style.display = "none";
document.getElementById("hrMenuMainContainer").style.display = 'block';
document.getElementById("StackRow").style.display = "none";
MainTable.align = "center"
MainTable.width = "855";
MainTable.height = '100%'
document.getElementById("fullframeNew").style.display = 'block';
document.getElementById("leftbartable").style.display = "none";
IFrame.width = "855";
IFrame.height = "475"
IFrame.align = "center"
}
}
}
function FrameSizeHome(size) {
if (catComView) {
if (catComView.toLowerCase() == "topper") {
var IFrame = document.getElementById("Container_InfiniOffice");
var IFrameMain = document.getElementById("IO_Office_Container");
var MainTable = document.getElementById("Page_Table");
document.getElementById("Banner_left_container").style.display = "none";
document.getElementById("Banner_bottom_container").style.display = "none";
document.getElementById("Banner_right_container").style.display = "none";
MainTable.align = "center"
MainTable.width = "855";
MainTable.height = '100%'
IFrame.width = "855";
IFrame.height = "475"
IFrameMain.height = "475"
IFrame.align = "center"
}
}
}
function XMLDOMObjectNew(xmlStr) {
try {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.load(xmlStr);
return xmlDoc.documentElement;
}
catch (e) {
try {
parser = new DOMParser();
xmlDoc = parser.parseFromString(xmlStr, "text/xml");
return xmlDoc.documentElement;
}
catch (e) { alert(e.message) }
}
}
function CheckMenu() {
try {
if (navigator.userAgent.indexOf('Firefox') >= 0) {
xmlDoc = document.implementation.createDocument("", "", null);
xmlDoc.async = false;
xmlDoc.load("../Config.xml");
if (xmlDoc.documentElement.nodeName == "Root") {
var Name = xmlDoc.documentElement.childNodes[1].childNodes[1].firstChild.nodeValue;
if (Name) {
if (Name.toLowerCase() == "horizontal") {
catComView = 'topper';
}
}
}
}
else if (navigator.userAgent.indexOf('MSIE') > 0) {
var xmlRequest = "../Config.xml";
var xmldoc = XMLDOMObjectNew(xmlRequest);
var Name = xmldoc.childNodes(0).childNodes(0).firstChild.text;
if (Name) {
if (Name.toLowerCase() == "horizontal") {
catComView = 'topper';
}
}
}
else {
try {
if (GetUAgent() == "") {
var xmlRequest = "../Config.xml";
xmlhttp = new XMLHttpRequest();
if (xmlhttp == null) {
return;
}
xmlhttp.onreadystatechange = onResponse;
xmlhttp.open("GET", xmlRequest, false);
xmlhttp.send(null);
}
} catch (e) {
alert("Your browser don't support DOMParser.");
}
}
}
catch (e) {
}
}
function onResponse() {
if (xmlhttp.readyState != 4) { return; }
if (xmlhttp.status != 200 && xmlhttp.readyState != 4) { alert("Problem retrieving XML data"); return; }
xDoc = xmlhttp.responseXML;
var name = xDoc.childNodes[0].childNodes[1].childNodes[1].firstChild.nodeValue;
if (name) {
if (name.toLowerCase() == "horizontal") {
catComView = 'topper';
}
}
}
function getIPhoneIViewForNew(funcName) {
switch (funcName) {
case "SetSourceNew": if (GetUAgent() != "") { iPhoneInifiniViewNew("block", "none"); } break;
case "SetSourceNewWithCommands": if (GetUAgent() != "") { iPhoneInifiniViewNew("block", "none"); } break;
}
}
function HomeURLRedirect(URL) {
if (URL.length > 0) {
parent.window.location.href = URL;
}
}
function iPhoneInifiniViewNew(iViewVisibility, mainCategoryVisibility) {
var elems = ["FavouriteProductDiv", "HistoryProductDiv"]
for (var i = 0; i < elems.length; i++) {
if (document.getElementById(elems[i]) != null) {
document.getElementById(elems[i]).style.display = "none";
}
}
var infiniViewTable = document.getElementById("IFrameTD");
var infiniViewFrame = document.getElementById("frame_details");
var mainCategories = document.getElementById("leftbartable");
document.getElementById("catBall").style.display = mainCategoryVisibility;
document.getElementById("actCmd_Container").style.display = iViewVisibility;
mainCategories.style.display = mainCategoryVisibility;
infiniViewTable.style.display = iViewVisibility;
infiniViewFrame.style.display = iViewVisibility;
}
function CatgeoryMenuSingle_WinCE() {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("POST", "Catalog/NewCatPageDis.aspx?iphone=true", true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
document.getElementById("DIV_LIST").innerHTML = "";
document.getElementById("DIV_LIST").innerHTML = req.responseText;
}
else {
}
}
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("");
}
}
function ShowHeader() {
if (GetUAgent() != "") {
if (isIPhoneApp()) {
document.getElementById('Headerbar').style.display = 'none';
}
else {
document.getElementById('Headerbar').style.display = 'block';
}
}
}
function HideLogo_wap() {
if (document.getElementById('LogoTable')) {
document.getElementById('LogoTable').style.display = 'none';
}
}
function GetUAgent() {
var UserAgnt = navigator.userAgent.toLowerCase();
var re = new RegExp("webkit/[5-9]|iemobile/[7-9]");
if (UserAgnt.indexOf('iphone') >= 0) {
return "iPhone";
}
else if (UserAgnt.indexOf('android') >= 0) {
return "android";
}
else if (UserAgnt.indexOf('blackberry') >= 0 && UserAgnt.match(re)) {
return "iPhone";
}
else if (UserAgnt.indexOf('symbianos/') >= 0 && UserAgnt.match(re)) {
return "iPhone";
}
else if (UserAgnt.indexOf('msie') >= 0 && UserAgnt.match(re)) {
return "iPhone"
}
else if (UserAgnt.indexOf('cfnetwork') >= 0 || UserAgnt.indexOf('darwin') >= 0) {
return "iPhone";
}
else if (queryStringNew('setapptype') == 'fbapp' ) {
return "iPhone";
}
else {
return "";
}
}
function GlobalObjectNew(objID) {
try {
if (document.getElementById(objID)) {
return document.getElementById(objID);
}
if (parent.document.getElementById(objID)) {
return parent.document.getElementById(objID);
}
}
catch (e) {
return document.all(objID);
}
}
function GetURLForInfiniOffice() {
if (document.getElementById('InfiniOffice1_InfiniOffice')) {
if (!isIE()) {
return document.getElementById('InfiniOffice1_InfiniOffice').contentWindow.GetURL();
}
else {
return document.frames['InfiniOffice1_InfiniOffice'].GetURL();
}
}
}
function InfiniViewMenu(CatId, ProURL, CatURL, StackData) {
OpencategoryUrl(CatURL);
OpenCategoryProduct(ProURL);
SetIframeMenuSrc(CatId);
}
var AllowPaing = true;
function SetIframeMenuSrc(Catid, Type, CatType) {
var CategoryType = 'NotSocial';
CatClick = true;
ProClick = false;
if (CatType) {
CategoryType = CatType;
}
UnLoadCommandsNew();
if (GetUAgent() != "") {
DisplayFrameWithCommandHideList();
}
var PageURL;
if (Catid) {
if (GetUAgent() != "") {
var Stack = StackArray.length;
if (StackArray[Stack - 1] != Catid) {
StackArray[Stack] = Catid;
}
}
if (Type) {
PageURL = "/\Catalog/InfiniViewMenu.aspx?categoryid=" + Catid + "&uAgent=" + GetUAgent() + '&DisplayStyleNo=' + Type + "&CatType=" + CategoryType;
}
else {
PageURL = "/\Catalog/InfiniViewMenu.aspx?categoryid=" + Catid + "&uAgent=" + GetUAgent() + "&CatType=" + CategoryType + '&DisplayStyleNo=0';
}
}
else {
PageURL = "/\Catalog/InfiniViewMenu.aspx?" + "uAgent=" + GetUAgent() + "&CatType=" + CategoryType;
}
if (window["frame_details"]) {
callWin7Notify("openview, Loader");
if (AllowPaing) {
PageURL = PageURL + "&AllowPaging=Y"
}
window["frame_details"].location.replace(PageURL);
}
else {
DisplayMenu(Catid, CatType)
}
}
function DisplayMenu(CatId, CatType) {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
if (CatType) {
req.open("Get", "/\Catalog/InfiniViewMenu.aspx?categoryid=" + CatId + "&uAgent=" + GetUAgent() + "&CatType=" + CatType, false);
}
else {
req.open("Get", "/\Catalog/InfiniViewMenu.aspx?categoryid=" + CatId + "&uAgent=" + GetUAgent(), false);
}
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
var result = req.responseText;
if (result != "") {
document.write(result);
}
}
else {
SetSourceNew("/\loadingpage.html");
}
}
req.send("");
}
}
function DisplayProductsInfiniMenu(CatID) {
if (CatID != '') {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("Get", "../Catalog/CheckProductsExist.aspx?catid=" + CatID, true);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
var result = req.responseText;
if (result == "y") {
UnLoadCommands();
SetIframeMenuSrc(CatID);
}
else {
if (resizeInfiniViewWithResolution == true) {
_fileURL = "http://" + window.location.host + '/cat_files/' + CatID + '/cat_img/resolution/index.htm';
SetSourceWithCommands(_fileURL);
currentCenterImage = _fileURL;
}
else {
_fileURL = "http://" + window.location.host + '/cat_files/' + CatID + '/cat_img/index.htm';
SetSource(_fileURL);
currentCenterImage = _fileURL;
}
}
}
else {
SetSourceNew("/loadingpage.html");
}
}
req.send("");
}
}
}
function showToolTip(e, Name, Price) {
if (GetUAgent() == "") {
var ToolTipNew = document.getElementById('ToolTip');
ToolTipNew.innerHTML = "<span class='TooltipName'>" + Name + "</span><br/><span class='TooltipPrice'>" + Price + "</span>";
ToolTipNew.style.left = (e.clientX + 40 + document.body.offsetLeft);
ToolTipNew.style.top = (e.clientY + 40 + document.body.offsetTop);
ToolTipNew.style.visibility = "visible";
}
}
function hideToolTip() {
if (GetUAgent() == "") {
var ToolTipNew = document.getElementById('ToolTip');
ToolTipNew.style.visibility = "hidden";
}
}
function GetExternalAppUrl() {
if (parent.ExAppUrl != "") {
return parent.ExAppUrl;
}
else {
return null;
}
}
function SetExternalAppiframeSrc(Src) {
if (Src != "") {
parent.ExAppUrl = Src;
var src = window.location.protocol + "//" + window.location.host + "/Mobile/ExternalApp.aspx";
parent.window.frames["ExternalAppIFrame"].location.replace(src);
}
}
function VideoFile_Click() {
var src = window.location.protocol + "//" + window.location.host + "/Mobile/iPhoneAppVideo.aspx?productid=" + this.CurrentProductID;
parent.window.frames["iPhoneAppVideo"].location.replace(src);
}
function isIPhoneApp() {
var usrAgnt = navigator.userAgent.toLowerCase();
if ((usrAgnt.indexOf('iphone') >= 0) && !(usrAgnt.indexOf('safari') >= 0)) {
return true;
}
}
function AddProductDirectinCart(ProductID, ReDirectToPage) {
if (ProductID != '') {
var requestURL = window.location.protocol + '//' + window.location.host + '/Product/Components/DirectInCart.aspx';
var xmlReq; //= QCDoCallback(requestURL,'');
xmlReq = DoCallbackNew(requestURL + '?product_id=', ProductID);
if (!ReDirectToPage) {
ReDirectToPage = '';
}
if (ReDirectToPage == '') {
SetSourceNew(window.location);
}
else {
var _fileURL = "http://" + window.location.host + ReDirectToPage;
SetSourceNew(_fileURL);
}
}
}
function DelProductDirectinCart(ProductID) {
if (ProductID != '') {
var requestURL = window.location.protocol + '//' + window.location.host + '/Shopping/Cart.aspx';
var xmlReq; //= QCDoCallback(requestURL,'');
xmlReq = DoCallbackNew(requestURL + '?remove_product=', ProductID);
var _fileURL = window.location.href;
SetSourceNew(_fileURL);
}
}
function calcHeight(obj)
{
try {
obj.style.height = "250px";
var the_height = obj.contentWindow.document.body.scrollHeight + 'px';
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
if (the_height == "0") {
obj.style.height = "250px";
}
else {
obj.style.height = the_height;
}
if (window["frame_details"]) {
var URL = window["frame_details"].location.href;
if (URL.indexOf('/ProductFiles/') > 0) {
var div_height = ((obj.contentWindow.document.body.scrollHeight / 100) * 80) + 'px';
parent.document.getElementById('OpenAppFullScreenDiv').style.height = div_height;
document.getElementById('OpenAppFullScreenDiv').style.display = 'block';
}
else {
document.getElementById('OpenAppFullScreenDiv').style.display = 'none';
}
try {
top.scroll(0, 0);
parent.top.scroll(0, 0);
}
catch (ex) {
window["frame_details"].scroll(0, 0);
}
}
}
catch (ex) {
obj.style.height = "250px";
try {
top.scroll(0, 0);
parent.top.scroll(0, 0);
}
catch (ex) {
window["frame_details"].scroll(0, 0);
}
}
}
function OpenAppFullScreen(ProID) {
try {
var URL = parent.window.frames["frame_details"].location.href;
if (URL.indexOf('/ProductFiles/') > 0) {
if (CurrentProductID != '0') {
parent.SetiPhoneAppFullScreenURL(CurrentProductID);
}
}
else if (ProID && ProID != "") {
parent.SetiPhoneAppFullScreenURL(ProID);
}
}
catch (ex) {
alert(ex);
}
}
function GetShopCount() {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
var myDate = new Date();
var myTime = myDate.getTime();
req.open("GET", "/\Mobile/ShoppingCartCount.aspx?t=" + myTime);
req.onreadystatechange = function() {
var ready = req.readyState;
if (ready == 4) {
var result = req.responseText;
document.getElementById("ShopCounter").innerHTML = result.toUpperCase();
if (GetUAgent() != "") {
var Count = result.substring(result.indexOf(";'>") + 3, result.indexOf("</span>"))
callWin7Notify("ShopCount," & Count);
var src = window.location.protocol + "//" + window.location.host + "/Mobile/CallShoppingCartCount.aspx?t=" + myTime + "&Count=" + Count;
window["ExternalAppIFrame"].location.replace(src);
}
}
}
}
req.send("");
}
function ShowCategoryiPhone() {
var myDate = new Date();
var myTime = myDate.getTime();
var UserAgnt = navigator.userAgent.toLowerCase();
var re = new RegExp("webkit/[5-9]|iemobile/[7-9]");
if (UserAgnt.indexOf('msie') >= 0 && UserAgnt.match(re)) {
try {
window.external.notify("openview,fullscreen_category");
}
catch (e) {
}
}
else {
var requestURL = window.location.protocol + '//' + window.location.host + '/Mobile/ShowCategory.aspx?t=' + myTime;
window["iPhoneAppFullScreen"].location.replace(requestURL);
}
}
function DisplayiPhoneMenu(CatId) {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
req.open("Get", "../Catalog/InfiniViewMenu.aspx?categoryid=" + CatId + "&uAgent=" + GetUAgent(), false);
req.onreadystatechange = function() {
var ready = req.readyState;
var data = null;
if (ready == 4) {
var result = req.responseText;
if (result != "") {
document.getElementById("DIV_LIST").innerHTML = "";
document.getElementById("DIV_LIST").innerHTML = req.responseText;
}
}
else {
document.getElementById("DIV_LIST").innerHTML = loadPagesImageNew;
}
}
req.send("");
}
}
function stackcall() {
var displaytype;
if (StackArray.length >= 1) {
if (CatClick == true && ProClick == false) {
if (StackArray.length > 1) {
StackArray.splice(StackArray.length - 1, 1);
}
}
if (parent.window.frames["frame_details"]) {
var URL = parent.window.frames["frame_details"].location.href;
URL = URL.toLowerCase();
displaytype = URL.substring(URL.indexOf('displaystyleno=') + 15, URL.length);
}
if (displaytype != undefined && displaytype.length < 2) {
if (IsSocial == true) {
SetIframeMenuSrc(StackArray[StackArray.length - 1], displaytype, 'Social');
}
else {
SetIframeMenuSrc(StackArray[StackArray.length - 1], displaytype);
}
}
else {
if (IsSocial == true) {
SetIframeMenuSrc(StackArray[StackArray.length - 1], '0', 'Social');
}
else {
SetIframeMenuSrc(StackArray[StackArray.length - 1]);
}
}
if (CatClick == false && ProClick == true) {
if (StackArray.length > 1) {
StackArray.splice(StackArray.length - 1, 1);
}
}
}
else {
if (IsSocial == true) {
MainCategory('Social');
}
else {
MainCategory();
}
}
}
function loadingiframeshow() {
SetSourceNew("/\loadingpage.html");
document.all('frame_details').height = "250px";
}
function AppAutoLogin() {
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
var myDate = new Date();
var myTime = myDate.getTime();
req.open("GET", "/\Mobile/AutoLogin.aspx?t=" + myTime, true);
req.onreadystatechange = function() {
var ready = req.readyState;
if (ready == 4) {
var result = req.responseText;
if (req.responseText != "") {
parent.window.frames["IOfficeFrameForTicketCounts"].location.replace(result);
}
}
}
}
req.send("");
}
function trackerMultipleProductsInsert(strProducts) {
strProducts.toString();
var parseCookie = new String(ReadCookie("infiniCookie"));
if (parseCookie != "") {
var arr = new Array();
if (strProducts.toString().indexOf(";") > 0) {
arr = strProducts.split(",");
}
else {
arr[0] = strProducts;
}
for (i = 0; i < arr.length; i++) {
var splitCookie = parseCookie.split("=");
var parseUserId = splitCookie[1].split("&");
var visiterId = parseUserId[0];
var tempurl, tempStr, strLth;
var newlth;
tempurl = document.location.href;
tempurl = tempurl.substring(tempurl.indexOf("//") + 2, tempurl.length);
var tempStr = tempurl.split("/");
var value = document.location.protocol + "//" + window.location.host + "/tracker/tracker.aspx?referrer=" + escape(document.referrer);
var docLocation = document.location.href;
value += "&customerId=" + visiterId;
value += "&location=" + escape(docLocation) + "?product_id=" + arr[i] + '%26js=trackerMultipleProductsInsert()';
var html_doc = document.getElementsByTagName("head").item(0);
var scriptTag = document.createElement("SCRIPT");
scriptTag.src = value;
html_doc.appendChild(scriptTag);
}
}
}
function ReviewContent(ProductID) {
var requestURL = window.location.protocol + '//' + window.location.host + '/Review/ReviewControl.aspx?product_id=' + ProductID; //+ "&Display=rating";
parent.window["frame_details"].location.replace(requestURL);
UnLoadCommandsNew();
parent.relatedProductBarHide();
}
function iPhoneDirectOpenProduct(ProductID) {
var requestURL = window.location.protocol + '//' + window.location.host + '/loadingpage.html';
window["frame_details"].location.replace(requestURL);
RelatedProductNew(ProductID);
ShowHideProductCommands('Product', ProductID, '?product_id=' + ProductID, ProductID, 'nosearch');
}
function AddComments(ProductId, Action) {
var requestURL = window.location.protocol + '//' + window.location.host + '/Review/ReviewControl.aspx?product_id=' + ProductId + "&Display=comments";
window.location.replace(requestURL)
}
function WriteComments(ProductID, ReplyParams, CatParams) {
UnLoadCommandsNew();
var Query = "";
if (ReplyParams && ReplyParams != "") {
Query = "&" + ReplyParams;
}
if (CatParams && CatParams != "") {
Query = "&CatType=" + CatParams;
}
var requestURL = window.location.protocol + '//' + window.location.host + '/Review/CommentsControl.aspx?product_id=' + ProductID + Query;
parent.window.frames["frame_details"].location.replace(requestURL);
}
function iOfficeAddProduct(CatID, CatName, sid) {
var requestURL;
var req = null;
req = initXMLHTTPRequestNew();
if (req) {
var myDate = new Date();
var myTime = myDate.getTime();
req.open("GET", "/\Mobile/IOfficeAddProduct.aspx?t=" + myTime, true);
req.onreadystatechange = function() {
var ready = req.readyState;
if (ready == 4) {
var result = req.responseText;
if (req.responseText != "") {
requestURL = "http://crm.business4less.co.uk/uploadimage.php?filename=captch&name=random.png&templateId=19&type=regular&title=empty&title_caption=Enter Title&CatId=" + CatID + "&CatName=" + CatName + "&sid=" + req.responseText;
parent.window.frames["IOfficeFrame"].src = requestURL;
}
}
}
}
req.send("");
}
function productstack(catid) {
if (catid) {
if (GetUAgent() != "") {
var Stack = StackArray.length;
if (StackArray[Stack - 1] != catid) {
StackArray[Stack] = catid;
}
ProClick = true;
CatClick = false;
}
}
}
function MenuDisplayCookieParser() {
var str = ReadCookie("ProductDisplayStyle");
var parseCookie = new String(str)
if (parseCookie != "") {
var splitCookie = parseCookie.split("=");
var Value = splitCookie[1]
return Value
}
}
function JoinMyNetwork(ProductID) {
var myDate = new Date();
var myTime = myDate.getTime();
var requestURL = window.location.protocol + '//' + window.location.host + '/Mobile/JoinNetwork.aspx?t=' + myTime + '&product_id=' + ProductID;
parent.window.frames["frame_details"].location.replace(requestURL);
}
function CouponCRMCall() {
var requestURL = window.location.protocol + '//' + window.location.host + '/Customer/home.aspx?method=coupon&loadscreen=services';
parent.window.frames["frame_details"].location.replace(requestURL);
}
function DirectToShareURLFB() {
if (GetUAgent() != "") {
DisplayFrameWithCommandHideList();
}
var query = window.location.search.substring(1);
var vars = query.split("frameUrl=");
parent.document.getElementById('frame_details').src = unescape(vars[1]);
}
function OpenScreenOther(type) {
closeshareddiv();
if (type == 'em') {
var shareUrl;
var ProductId = ParseQueryIframe("frame_details", "product_id");
var url = "http://" + window.location.host + "/Mobile/AppSharedURL.aspx?GetShareUrl=1&Pro_ID_New=" + ProductId;
var xmlRequest = DoCallbackNew(url, "")
if (xmlRequest) {
var str = xmlRequest.responseText;
shareUrl = str.split('~~~')[0];
productName = str.split('~~~')[1];
}
URL = window.location.protocol + '//' + window.location.host + '/loadmailclient.aspx?subject=' + productName + ' link for your review"&body=For more information, please visit the following link: ' + escape(shareUrl);
parent.document.getElementById('IOfficeFrame').src = URL;
}
else {
var URL;
var ProductId = ParseQueryIframe("frame_details", "product_id");
URL = window.location.protocol + '//' + window.location.host + '/Mobile/AppSharedURL.aspx?Pro_ID_New=' + ProductId + '&display=' + type;
parent.document.getElementById('frame_details').src = URL;
UnLoadCommandsNew();
relatedProductBarHide();
}
}
function closeshareddiv() {
document.getElementById('animdemo').style.display = 'none'
}
var PreviousCatID = new Array();
function CatBack(CatType) {
PreviousCatID.pop();
var prevID = PreviousCatID.pop();
PreviousCatID.push(prevID);
if (prevID) {
SetIframeMenuSrc(prevID);
} else {
if (!(CatType == "" || CatType == "~CategoryType~")) {
SetIframeMenuSrc(null, null, CatType)
}
}
}
function CategoryHistory(CatID) {
PreviousCatID.push(CatID);
}
function ShowSharePopup() {
parent.window.scroll(0, 0);
var UserAgnt = navigator.userAgent.toLowerCase();
var re = new RegExp("webkit/[5-9]|iemobile/[7-9]");
if (UserAgnt.indexOf('msie') >= 0 && UserAgnt.match(re)) {
try {
window.external.notify("openview,ShowSharePopup");
}
catch (e) {
}
}
}
var GetLatitude;
var GetLongtitidue;
var GetDistance = 8000;
function SetSocailProductLetLong(lat, lng) {
GetLatitude = lat;
GetLongtitidue = lng;
SetiPhonePosition();
}
function ProductGeoLocation(distance) {
if (distance) {
GetDistance = distance
}
else {
if (ReadCookie("nearBy") != "") {
GetDistance = ReadCookie("nearBy");
}
}
if ((GetLatitude && GetLongtitidue)) {
var Query = "DisplayStyleNo=0&ProductCriteria=ProductGeoLocation&latitude=" + GetLatitude + "&longtitude=" + GetLongtitidue + "&distance=" + GetDistance;
wapSetSource('frame_details', '../Catalog/InfiniViewMenu.aspx?' + Query);
}
}
function IOfficeViewMap(distance, sid) {
var url = "http://www.business4less.co.uk/showmapview.php?sid=" + sid + "&xml=&distance=" + distance;
if (isWindows7OS()) {
window.external.notify(url);
} else {
parent.document.getElementById('IOfficeFrame').src = url;
}
}
var PreviousCatID = new Array();
function CatBack(CatType) {
PreviousCatID.pop();
var prevID = PreviousCatID.pop();
PreviousCatID.push(prevID);
if (prevID) {
SetIframeMenuSrc(prevID);
} else {
SetIframeMenuSrc(null, null, CatType)
}
}
function CategoryHistory(CatID) {
var divid = GlobalObjectNew('MenuStyleBar');
if (divid) {
divid.innerHTML += "a";
}
PreviousCatID.push(CatID);
}
function RedirectTwitterURL(URL) {
parent.window.location.href = URL
}
function callWin7Notify(eventNameAndtype) {
var UserAgnt = navigator.userAgent.toLowerCase();
var re = new RegExp("webkit/[5-9]|iemobile/[7-9]");
if (UserAgnt.indexOf('msie') >= 0 && UserAgnt.match(re)) {
try {
window.external.notify(eventNameAndtype);
}
catch (e) {
}
}
}
function OpenInfiniSearchCat(KeyWord, CatId) {
var url = window.location.protocol + '//' + window.location.hostname + '/AJAX/ProductDisplay.aspx?ProductSearch=' + KeyWord + '&catid=' + CatId;
window.location.assign(url);
}
function OpenVisitedApps() {
var url = window.location.protocol + '//' + window.location.hostname + '/AJAX/FavBarResult.aspx?Mode=VisitedAppsList';
window.location.assign(url);
top.scroll(0, 0);
}
function OpenInfiniSearchMyOwnList() {
var url = window.location.protocol + '//' + window.location.hostname + '/AJAX/ProductDisplay.aspx?SearchType=MyOwnList';
window.location.assign(url);
}
function OpenInfiniSearchNearby() {
var url = window.location.protocol + '//' + window.location.hostname + '/AJAX/ProductDisplay.aspx?SearchType=nearbyapps&AllowPaging=y';
parent.window.frames["frame_details"].location.replace(url);
}
function GetProductNextRecords(ContainerID, AnyQuery) {
var O = GlobalObject(ContainerID);
try {
var PageID = ContainerID.split("_");
var NextPage = GlobalObject("page_" + (parseInt(PageID[1]) + 1));
if (NextPage) {
NextPage.style.display = 'block';
}
var URL = "../Catalog/PagingProducts.aspx?" + AnyQuery + "&PageID=" + PageID[1];
var xmlRequest = DoCallbackNew(URL, "")
if (xmlRequest) {
var str = xmlRequest.responseText;
O.innerHTML = str;
}
else {
}
} catch (ex) {
alert("GetProductNextRecords: " + ex)
}
}
function RedirectInfiniSearch(DomainName, ProID) {
InfiniAppProductFile(ProID);
SetProductButton(ProID);
parent.scriptToRunOnPopState += "SetProductButton('" + ProID + "');";
}
function OpenInfiniSearchCat(KeyWord, CatId) {
var url = window.location.protocol + '//' + window.location.hostname + '/AJAX/ProductDisplay.aspx?ProductSearch=' + KeyWord + '&catid=' + CatId;
window.location.assign(url);
}
function OpenInfiniSearchMyOwnList() {
var url = window.location.protocol + '//' + window.location.hostname + '/AJAX/ProductDisplay.aspx?SearchType=MyOwnList';
window.location.assign(url);
}
function SetiPhonePosition() {
var myDate = new Date();
var myTime = myDate.getTime();
var querystr = "?t=" + myTime + "&iphonelatitude=" + GetLatitude + "&iphonelongitude=" + GetLongtitidue;
var xmlRequest = DoCallbackNew('/\Mobile/iPhonePosition.aspx', querystr)
}
function IOfficeViewMap(distance, sid, searchtext) {
var url = "http://" + window.location.host + "/showmapview.php?sid=" + sid + "&xml=&distance=" + distance + "&searchtext=" + searchtext;
if (isWindows7OS()) {
window.external.notify(url);
} else {
parent.document.getElementById('IOfficeFrame').src = url;
}
}
function Create_Shortcut_onclick(productId, timeStamp) {
var url = "http://shortcut.infini.com/redirect.php?t=" + String(timeStamp) + "&pid=" + String(productId)
parent.document.getElementById('IOfficeFrame').src = "http://infinimation.com/addshortcutinmainpage.php?url=" + escape(url);
}
function Claim_Coupon_Onclick(ProductId, CustomerId, MerchantId) {
var url = "/Mobile/ClaimCoupon.aspx?ProductId=~pid~&MerchantId=~mid~";
url = url.replace("~pid~", ProductId);
url = url.replace("~mid~", MerchantId);
document.getElementById("frame_details").src = url;
}
function ShowProductMap(sid, MyXml) {
var url = window.location.protocol + "//" + window.location.host + "/showmapview.php?sid=" + sid + "&xml=" + MyXml + "&distance=&searchtext=";
if (isWindows7OS()) {
window.external.notify(url);
} else {
parent.document.getElementById('IOfficeFrame').src = url;
}
}
function ShowProductMapWithToolbar(sid, MyXml) {
var url = window.location.protocol + "//" + window.location.host + "/showmapviewwithtoolbar.php?sid=" + sid + "&xml=" + MyXml + "&distance=&searchtext=";
if (isWindows7OS()) {
window.external.notify(url);
} else {
parent.document.getElementById('IOfficeFrame').src = url;
}
}
function isWindows7OS() {
var UserAgnt = navigator.userAgent.toLowerCase();
var re = new RegExp("webkit/[5-9]|iemobile/[7-9]");
return (UserAgnt.indexOf('msie') >= 0 && UserAgnt.match(re)) ? true : false;
}
function OpenCouponOrderScreen(params) {
params = unescape(params);
var paramArray = params.split(':');
var url = window.location.protocol + '//' + window.location.host + '/orders/previousorder.aspx?buttonON=no&productID=' + paramArray[1] + '&cid=' + paramArray[2] + '&mid=' + paramArray[3];
SetSourceNew(url);
}
function ShowSharedPopupWin7(Show, Hide) {
var url = window.location.protocol + "//" + window.location.host + "/Mobile/OpenNativeSharedURL.aspx";
if (window.location.host == 'shops.infini.com') {
if (isWindows7OS()) {
window.external.notify(url);
}
else {
window["SetAppButtonFrame"].location.replace(url);
}
}
else {
parent.document.getElementById(Show).style.display = "block";
parent.document.getElementById(Hide).style.display = "none";
}
}
function RefineSearchProduct(URL) {
window.location = URL ;
}
function InfiniAppProductFile(ProductID) {
currentRelatedProId = ProductID;
var requestURL = window.location.protocol + '//' + window.location.host + '/Mobile/ProductFile.aspx?product_id=' + ProductID + "&Display=rating";
parent.window["frame_details"].location.replace(requestURL);
}
function SetProductButton(ProID) {
var URL = window.location.protocol + '//' + window.location.host + "/mobile/SetProductButton.aspx?Buttons=0:ShowSharedPopupWin7('animdemo','animations'):1:0;1:parent.FavProductControl('" + ProID + "','add'):1:0;2:LaunchMerchantApp_wrapper():1:0;3:AthenaChat():1:0;4:WriteComments('" + ProID + "',null,''):1:0";
if (isWindows7OS()) {
window.external.notify(URL);
}
else {
}
}
function Wap_AddComments(ContainerID, ProductID) {
var O = GlobalObjectNew(ContainerID);
try {
O.innerHTML = "<table width='100%' cellspacing='0' cellpadding='0' style='border:solid 1px #ccc' ><tr><td width='100%'><input id='tbWriteReview' type='text' style='width:100%; height:30px; border:0'  /></td><td><img src='../wap_images/sendicon.jpg' id='SendComments'  /></td></tr></table>";
GlobalObjectNew('SendComments').onclick = function() {
var tb = GlobalObjectNew('tbWriteReview');
WriteComments(ProductID, '&action=WRITE&Comments=' + tb.value + '');
}
} catch (ex) {
alert(ex);
}
}
function loadDefaultButtonsForApp() {
var url = window.location.protocol + '//' + window.location.host + "/mobile/loaddefaultbuttons.aspx";
if (isWindows7OS()) {
window.external.notify(url);
} else {
parent.document.getElementById('IOfficeFrame').src = url;
}
}
function getProductIdforApp() {
var page = new PageQueryNew(parent.window["frame_details"].location.search);
if (isWindows7OS()) {
return unescape(page.getValue("product_id"));
} else {
return (page.getValue("product_id"));
}
}
function getProductCommentsCount(productid) {
var xmlRequest = DoCallbackNew("../Review/TotalCommentsCount.aspx?product_id=" + productid, '');
if (isWindows7OS()) {
return xmlRequest.responseText;
} else {
return xmlRequest.responseText;
}
}
function RefineSearchCategoryMultipleSelection(Keyword, no) {
var elm = document.getElementsByTagName("input");
var CBValues = "";
for (i = 0; i < elm.length; i++) {
if (elm[i].type == "checkbox" && elm[i].checked) {
CBValues += elm[i].value + ",";
}
}
CBValues = CBValues.substr(0, CBValues.length - 1);
if (CBValues.length > 0) {
document.location.href = "../Mobile/RefineSearch.aspx?keyword=" + Keyword + "&headershow=y&type=1&no=" + no + "&AllowPaging=y&CatNo=" + CBValues;
}
else {
document.location.href = "../AJAX/ProductDisplay.aspx?ProductSearch=" + Keyword + "&AllowPaging=Y"
}
}
function RefineSearchCategoryMultipleSelectionBackword(CatNo, no, Keyword) {
document.location.href = "../Mobile/RefineSearch.aspx?keyword=" + Keyword + "&headershow=y&type=0&requestforcategory=1&no=" + no + "&AllowPaging=y&CatNo=" + CatNo;
}
var EnumPresentationFileType = {
"Product": 1,
"ConvinceMe": 2,
"WhatYouGet": 4,
"Information": 5,
"Gallery": 11
}
function SetiPhoneAppFullScreenURLForInfiniApp(ProdID, PresentationFileType, view, CurrentFile) {
var location = window.location.protocol + "//shops.infini.com"; //"//" + window.location.host;
var DynamicParams = "";
if (PresentationFileType == EnumPresentationFileType.Gallery) {
DynamicParams += "&title=Pictures&bb=Back";
if (!view) {
view = "thumbnails";
}
if (view.length > 4 && "thumbnailsgallery".indexOf(view.toLowerCase()) != -1) {
var sourceURL = location + "/Mobile/ProductFileThumbnailGallery.aspx?productid=" + ProdID;
var url = "http://infinimation.com/showinfofullscreen.php?url=" + escape(sourceURL) + DynamicParams;
document.getElementById("iPhoneAppFullScreen").src = url;
return;
}
}
if (!CurrentFile) {
CurrentFile = 1;
}
var Location_GetFilesCount = location + "/Catalog/temp.aspx?CASE=" + PresentationFileType + "&ProductID=" + ProdID;
var XMLHTTPResponse = DoCallbackNew(Location_GetFilesCount, "");
if (XMLHTTPResponse.status == 200) {
var FilesCount = XMLHTTPResponse.responseText;
var src = location + "/Mobile/iPhoneAppFullScreen.aspx?productid=" + ProdID + "&type=" + PresentationFileType + "&filecount=" + FilesCount + "&currentno=" + CurrentFile + "&fileFolder=250x250" + DynamicParams;
parent.window.frames["iPhoneAppFullScreen"].location.replace(src);
}
}
function updateFBAccessToken(accessToken, Status) {
if (Status == 'Success') {
var querystr = '?Action=[Action]&FBAccessToken=[FBAccessToken]';
querystr = querystr.replace("[Action]", "SetFBAccessToken");
querystr = querystr.replace("[FBAccessToken]", accessToken);
var xmlRequest = DoCallbackNew('/Mobile/SetParams.aspx', querystr);
var requestURL = window.location.protocol + '//' + window.location.host + '/Customer/FB_SignIn.aspx';
var frame_details = document.getElementById('frame_details');
var frameSrc = frame_details.src.toLowerCase();
if (frameSrc.indexOf('blankpage.htm') != -1) {
frame_details.src = requestURL;
}
else {
frame_details.src = frame_details.src;
}
}
}
function setIOfficeFrame(url) {
parent.document.getElementById('IOfficeFrame').src = url;
}
var InfiniAppProduct = {
OldID: "_vanue",
Buttons: {
Vanue: function(ProductID) {
InfiniAppProduct.SwapStyle("_vanue");
InfiniAppProduct.ViewsDisplay(["_view1"], "block");
InfiniAppProduct.ViewsDisplay(["_view2", "_view3"], "none");
},
Information: function(ProductID) {
var page = "/ProductFiles/" + ProductID + "/" + EnumPresentationFileType.Information + "/1/250x250/index.htm";
InfiniAppProduct.SwapStyle("_info");
InfiniAppProduct.ViewsDisplay(["_view1", "_view3"], "none");
InfiniAppProduct.ViewsDisplay(["_view2"], "block");
var frm = window['frame_details']["IFPageContainer"];
frm.location.replace(page);
},
Coupons: function(IsCouponsExists, ProductID) {
InfiniAppProduct.SwapStyle("_coupons");
switch (IsCouponsExists.toString().toLowerCase()) {
case "yes":
InfiniAppProduct.ViewsDisplay(["_view1", "_view2"], "none");
InfiniAppProduct.ViewsDisplay(["_view3"], "block");
AjaxCall(InfiniAppProduct.Views("_view3"), "/Catalog/temp.aspx?ProductID=" + ProductID + "&Coupon=Y", "");
break;
case "no":
InfiniAppProduct.ViewsDisplay(["_view1", "_view2", "loading"], "none");
InfiniAppProduct.ViewsDisplay(["_view3", "nocoupon"], "block");
break;
}
},
CheckIn: function(ProductID) {
var acookie = ReadCookie("IOFrameSessionID");
var location = 'http://crm.' + document.domain + '/checkin.php?ProductId=' + ProductID + '&' + acookie
var url = "http://infinimation.com/showinfofullscreen.php?url=" + escape(location);
parent.document.getElementById("iPhoneAppFullScreen").src = url;
},
Gallery: function(ProductID) {
SetiPhoneAppFullScreenURLForInfiniApp(ProductID, parent.EnumPresentationFileType.Gallery, 'thumbnails');
}
},
SwapStyle: function(ButtonID) {
var e = window['frame_details'][ButtonID];
if (this.OldID != ButtonID) {
e.className = "ProductFileTopBar ProductFileTopBarHover";
window['frame_details'][this.OldID].className = "ProductFileTopBar";
this.OldID = ButtonID;
}
},
Views: function(View) {
return window['frame_details'][View];
},
ViewsDisplay: function(View, Display) {
for (i = 0; i < View.length; i++) {
this.Views(View[i]).style.display = Display;
}
}
};
function RedirectToMerchantAppProduct(DomainName, ProductID) {
parent.window.location.href = DomainName + "?noheader=1&ProURL_ID=" + ProductID
}

