// JavaScript Document naeem bhatt naeembhatti@gmail.com
//add your tags testing+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function delete_my_tag_deal(deals_tags_by_user_id,deal_id)
{
if(document.getElementById('dumy_hidden_bookmark'))
{
page='../../delete_tags.php?deals_tags_by_user_id='+deals_tags_by_user_id;
}else{
page='delete_tags.php?deals_tags_by_user_id='+deals_tags_by_user_id;
}
request.open('POST', page);
request.onreadystatechange = function () {
if (request.readyState == 4)
{
//document.getElementById('show_user_tags_deal'+deal_id).innerHTML='';//empty previuse record
show_user_tags_deal(deal_id);
show_tags_deal(deal_id);
//document.frm.edit_deal_tags_name.value='';
//document.getElementById('show_user_tags').style.display = "none";
}
}
request.send('');
}
function show_tags_deal(deal_id){
if(document.getElementById('dumy_hidden_bookmark'))
{
page='../../show_tags.php?deal_id='+deal_id;
}else{
page='show_tags.php?deal_id='+deal_id;
}
request.open('POST', page);
request.onreadystatechange = function () {
if (request.readyState == 4) {
responsestring = request.responseText;
var new_list_name = responsestring.split(",");
var mystring
x=document.getElementById('show_tags_deal'+deal_id);
document.getElementById('show_tags_deal'+deal_id).style.display = "block";
x.innerHTML='';
x.innerHTML ='Tags: ';
//var for_text_box_value='';
for(var i=1; i';
document.getElementById('imgMember').src = loadingImage.src;
//for image=======================================
request.onreadystatechange = parseInfo_get_users_contacts;
}
request.send('');
}
function parseInfo_get_users_contacts()
{
if(request.readyState == 4){
x=document.getElementById('display_image');
x.style.display ='none';
y=document.getElementById('display_record');//setTimeout("y.style.display ='block'",50000);
y.style.display ='block';
y.innerHTML=request.responseText;
}
}
function rate_redirect(rate,deal_id,rate_it,red){
var url="";
if (condition = true) url="sign_in.php";
setTimeout("document.location='"+url+"'", 0);
// setTimeout(window.open(url), 0);
// setTimeout(window.opener.refresh(), 0);
}
//=============================================================================
function open_nav_configurable_window(url,loc, tool, menu, scrollV, resizeV, leftV, topV, widthV, heightV)
{
var options = "location=" + loc + "," +
"toolbar=" + tool + "," +
"menubar=" + menu + "," +
'directories=0,' +
'status=0,' +
"scrollbars=" + scrollV + "," +
"resizable=" + resizeV + "," +
"left=" + leftV + "," +
"top=" + topV + "," +
"width=" + widthV + "," +
"height=" + heightV ;
// sl1.html',1,1,1,1,200,0,620,450
//alert(options.toString());
var mW = window.open(url,"configurable",options);
}
function open_small_window(url){
window.open(url,"smaller","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,width=450,height=470");
//smaller.focus();
}
function refresh_open_small_window(url){
myWindow = window.open(url,"smaller","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,width=450,height=470");
myWindow.location=url;
}
function open_large_window(url){
window.open(url,"larger","toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=640,height=480");
//larger.focus();
}
function open_small_scrollable_window(url)
{
var options = 'location=0,' +
'toolbar=0,' +
'menubar=0,' +
'directories=0,' +
'status=0,' +
'scrollbars=2,' +
'resizable=0,' +
'left=400,top=150,width=488,height=545';
var mW = window.open(url,"largerimagewindow",options);
}
function open_small_scrollable_window_aff(url)
{
var options = 'location=1,' +
'toolbar=1,' +
'menubar=1,' +
'directories=1,' +
'status=1,' +
'scrollbars=2,' +
'resizable=1,' +
'left=28,top=70,width=965,height=500';
var mW = window.open(url,"largerimagewindow",options);
}
function open_popup_window(url)
{
var options = 'location=0,' +
'toolbar=0,' +
'menubar=0,' +
'directories=0,' +
'status=0,' +
'scrollbars=0,' +
'resizable=0,' +
'left=400,top=150,width=380,height=500';
var mW = window.open(url,"popupwindow",options);
}
function open_xlarge_window(url){
window.open(url,"xlargewindow","toolbar=0,location=0,directories=0,status=1,maximize=0,menubar=0,scrollbars=1,resizable=0,width=500,height=600");
}
function open_popup_window_position(url)
{
var options = 'location=0,' +
'toolbar=0,' +
'menubar=0,' +
'directories=0,' +
'status=0,' +
'scrollbars=0,' +
'resizable=0,' +
'left=150,top=180,width=350,height=200';
var mW = window.open(url,"popupwindow",options);
}
function open_configurable_window(url, scrollV, resizeV, leftV, topV, widthV, heightV)
{
var options = 'location=0,' +
'toolbar=0,' +
'menubar=0,' +
'directories=0,' +
'status=0,' +
"scrollbars=" + scrollV + "," +
"resizable=" + resizeV + "," +
"left=" + leftV + "," +
"top=" + topV + "," +
"width=" + widthV + "," +
"height=" + heightV ;
//alert(options.toString());
var mW = window.open(url,"configurable",options);
}
function open_fully_configurable_window(url, loc, tool, menu, dir, sta, scrollV, resizeV, leftV, topV, widthV, heightV)
{
var options = 'location=' + loc + "," +
'toolbar=' + tool + "," +
'menubar=' + menu + "," +
'directories=' + dir + "," +
'status=' + sta + "," +
"scrollbars=" + scrollV + "," +
"resizable=" + resizeV + "," +
"left=" + leftV + "," +
"top=" + topV + "," +
"width=" + widthV + "," +
"height=" + heightV ;
//alert(options.toString());
var mW = window.open(url,"configurable",options);
}
function open_window_submit(url)
{
open_nav_configurable_window(url,0,1,1,1,1,65,0,720,520);
document.ctc_check_store_inv.submit();
return(false);
}
function open_window_logon(url)
{
open_small_window(url);
document.manage_gift_registry.submit();
return(false);
}
function show_blog_code(){
if(document.getElementById('show_blog_code').style.display=="none")
{
document.getElementById('show_blog_code').style.display = "block";
}else{
document.getElementById('show_blog_code').style.display = "none";
}
}
//show contacts==========================================================
function check_email_selected(fields){
if(fields.value=='show_email'){
document.getElementById('div_'+fields.name).style.display = "block";
}else{
document.getElementById('div_'+fields.name).style.display = "none";
}
}
//========================================================================
//add to dealarmy==========================================================
function perf_action(){
if (document.book.page.value.match(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/)==null)
{
document.book.page.focus();
show_error("Please enter a valid url format.\ni.e. http://www.address.com or http://address.com",'div_error_page');
}else{
document.book.action='add_deal.php';
document.book.submit();
}
}
function maskKeyPress(objEvent)
{
//alert();
var iKeyCode;
iKeyCode = objEvent.keyCode;
if(iKeyCode==13){
if (document.book.page.value.match(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/)==null)
{
document.book.page.focus();
show_error("Please enter a valid url format.\ni.e. http://www.address.com or http://address.com",'div_error_page');
return false;
}else{
document.book.action='add_deal.php';
document.book.submit();
}
}
}
function send_contact_id(){
var val = document.getElementById('contact_id').options[document.getElementById('contact_id').selectedIndex].value;
document.getElementById('email').value += val+',';
// var val2 = document.getElementById('email').value;
// val2 = 'ffffffffffffffffffff';
//val2 = val+', ';
//alert(val2);
}
//========================================================================
//get contacts==========================================
function get_browse_by_price(url)
{
//for hidding google ads=================================
document.getElementById('ads_1').style.display = "none";
document.getElementById('ads_2').style.display = "none";
document.getElementById('ads_3').style.display = "none";
//for hidding google ads=================================
//document.write(url);
var page=url.split("?");
var category_name=page[1].split("=");
request.open('POST', url);
//if(document.getElementById('horizVal').value!=0){
//for image=======================================
y=document.getElementById('display_record');
y.innerHTML='';
y.style.display ='none';
x=document.getElementById('display_image');
x.style.display ='block';
var text = x.innerHTML ="getting gift ideas, please wait... ";
var loadingImage = new Image();
loadingImage.src = "images/loading.gif";
x.innerHTML = text+'
';
document.getElementById('imgMember').src = loadingImage.src;
//for image=======================================
request.onreadystatechange = parseInfo_deals;
//}
request.send('');
}
function parseInfo_deals()
{
if(request.readyState == 4){
x=document.getElementById('display_image');
x.style.display ='none';
y=document.getElementById('display_record');//setTimeout("y.style.display ='block'",50000);
y.style.display ='block';
responsestring = request.responseText;
var msg = responsestring.split("@@@@@@@@@@");
y.innerHTML = msg[0];
total_records = msg[1];
//for google ads=============================================
if(total_records>3){
document.getElementById('ads_1').style.display = "block";
}
if(total_records>12){
document.getElementById('ads_2').style.display = "block";
}
if(total_records>18){
document.getElementById('ads_3').style.display = "block";
}
//for google ads=============================================
//my_text = replace(replace(request.responseText,'','!!!!!'),'!!!!!','');
my_text = replace(replace(my_text,'google_ad_client = "pub-8412861453096424"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel ="8021588331','$$$$$'),'$$$$$','google_ad_client = "pub-8412861453096424"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel ="8021588331');
y.innerHTML = (replace(replace(my_text,'