 //var javascriptLib = 'http:\/\/costumecraze.shoptog.com\/';
          

var javascriptLib = 'http:\/\/files.shoptog.com\/Clients\/CostumeCraze\/prod\/';
//var javascriptLib = 'http:\/\/files.shoptog.com\/Clients\/CostumeCraze\/uat\/';
var STMOBILE=false;
var STCONCIERGE=false;
 function _ShopTogether() {
	this.id = "";
	this.type = "";
	this.URL = "";
	this.name = "";
	this.subcategory = "";
	this.category = "";
	this.imageThumbnailURL = "";
	this.imageLargeURL = "";
	this.custom1 = "";
	this.custom2 = "";
	this.description = "";
	this.domIsLoaded = false;
	this.tb = null;
	var ITEM = this.ITEM;
	var MESSAGE = this.MESSAGE=null;
	
	var Initialize = this.Initialize = function(item){
		
		if(typeof item !='undefined'){
			this.ITEM=item;
		
		}else{
			this.ITEM = {
				id: this.id,
				type: this.type,
				category: this.category,
				subcategory: this.subcategory,
				name: this.name,
				imageThumbnailURL: this.imageThumbnailURL,
				imageLargeURL: this.imageLargeURL,
				description: this.description,
				URL: this.URL,
				custom1: this.custom1,
				custom2: this.custom2
			};
		}
		//alert(item.id)
		if(typeof this.ITEM.imageThumbnailURL=='undefined'){
			this.ITEM.imageThumbnailURL=STCONFIG.get('IMAGES')+'default_product.png';
		}else{
			if(this.ITEM.imageThumbnailURL==''){
				this.ITEM.imageThumbnailURL=STCONFIG.get('IMAGES')+'default_product.png';
			}
		}
		
	}
	var sendItemToCrowd = this.sendItemToCrowd = function(item){
		this.ITEM = item
		ShopTogetherAPI.sendItemToCrowd(_item);
	}
	var updateCurrentItem = this.updateCurrentItem = function(item){
		if(ShopTogetherUtilities.urlVariable('st_test')!=''){
				alert(item.name)
			}
	};
	var _Share = this._Share = function(){
		var message = this.message = function(message){
			this.MESSAGE = {
				subject:message.subject,
				body:message.body,
				clickThruURL:message.clickThruURL,
				imageURL:message.imageURL
			}
			
			ShopTogetherEvents.sendShareCustom(message.clickThruURL);
			
		}
		var currentItem = this.currentItem = function(){
			this.MESSAGE = {
				subject:this.ITEM.name,
				body:this.ITEM.description,
				clickThruURL:this.ITEM.URL,
				imageURL:this.ITEM.imageThumbnailURL
			}
			ShopTogetherEvents.sendShareCustom(this.ITEM.URL);
		}
	};
	var Share = this.Share = new _Share();

}

var ShopTogether = new _ShopTogether();

 
function ismobilesafari(){
    if(navigator.userAgent.indexOf('iPod') != -1){return true;}
    if(navigator.userAgent.indexOf('iPhone') != -1){return true;}
    if(navigator.userAgent.indexOf('iPad') != -1){return true;}
    else{return false;}
}
if(ismobilesafari()){
	STMOBILE=true;
	//document.write("<script language=\"javascript\" type=\"text/javascript\" src=\"" +javascriptLib +"ShopTogetherMobile.js\"></script>");
}else{
	STMOBILE=false;
	document.write("<script language=\"javascript\" type=\"text/javascript\" src=\"" +javascriptLib +"ShopTogetherStandardnew.js\"></script>");
document.write("<script language=\"javascript\" type=\"text/javascript\" src=\"" +javascriptLib +"Azurenew.js\"></script>");
}

