/**
 * eltToAppend - tag or id of the DOM element, to which we want to append an iframe
 * wizardPath - full URL to wizard
 */

var elt = document.getElementById(eltToAppend);
if (elt == null){
    elt = document.getElementsByTagName(eltToAppend)[0];
}
var iframe = document.createElement("iframe");
var scrolling = 'no';
if(!isRelease){
    scrolling = 'yes';
}
if (typeof(mode) == 'undefined'){
    mode = '';
}
if (typeof(reed) == 'undefined'){
    reed = '';
}
if (typeof(img) == 'undefined'){
    img = '';
}

var refresh = true;
function explicitRefresh(elt){
    if(!refresh){
        return;
    }
    refresh = false;
    elt.src = elt.src;
}

document.write(
        ['<iframe onload="explicitRefresh(this)" style="visibility:hidden;" scrolling="',
            scrolling, '" id="wizard_iframe" width="100%" height="1" frameborder="0" ',
            'marginwidth="0" marginheight="0"',
            'src="',wizardPath,'iframe.php?',
            'uid=',uid,            
            '&productName=',productName,
            '&productPrice=',productPrice,
            '&mediaType=',mediaType,
            '&sessId=',sessId,
            '&categoryDescription=',categoryDescription,
            '&ldocIds=',ldocIds,
            '&productId=',productId,
            '&productDescription=',productDescription,
            '&user_id=',user_id,
            '&mode=',mode, 
            '&reed=',reed, 
            '&img=',img,
            '&store_affiliate_code=',store_affiliate_code,
            '"></iframe>'].join(""));
iframe.src = iframe.src;