//function for connecting to display image page
//<--<![CDATA[

function nextpage(id) {
//alert(id);
document.getElementById('cat_id').value=id;
document.display.submit();
}

function nextpage_gal(id) {
alert(id);
document.getElementById('cat_id').value=id;
document.display_gal.submit();
}

function nextpage_new(id) {
alert(id);
document.getElementById('cate_id').value=id;
document.display_new.submit();
}

//funtion for home_category
function edit_home_image(id) {
document.getElementById('sel_cat').value=id;
document.edit_home.submit();
}

//fuction for manage_gallery
function manage_gallery(id) {
document.getElementById('sel_cat').value=id;
document.edit_gallery.submit();
}

/*function add_image(id) {
//alert(id);
document.getElementById('cat_name').value=id;
document.add_img.submit();
}
*/


//function for display category 

function next(id) {
document.getElementById('category_id').value=id;
document.display_title.submit();
}

//function for edit category

function editcat(id) {
document.getElementById('category_id').value=id;
document.edit_cat.submit();
}

function Impcat_edit(id) {
document.getElementById('impcat_id').value=id;
document.edit_imp_cat.submit();
}

function publish_single(pub_id,pub_val)
{
document.getElementById('pub_cat_oth').value=pub_id;
document.getElementById('pub_value_oth').value=pub_val;
document.getElementById('pub_value_mul').value='';
document.publish_cat.submit();
}

function modify_status(chk,a)
{
var str='';
for (i = 0; i < chk.length; i++) {
	if(chk[i].checked == true) 
	{ 
		str =str+chk[i].value+","; 
	}
}
document.getElementById('pub_cat_oth').value=str;
document.getElementById('pub_value_mul').value=a;
document.publish_cat.submit();
}

function delete_cat(chk)
{
var answer=confirm("Do you really want to delete?");
if(answer) {
var str='';
for (i = 0; i < chk.length; i++) {
	if(chk[i].checked == true) 
	{ 
		str =str+chk[i].value+","; 
	}
}
document.getElementById('del_cat_id').value=str;
document.del_cat.submit();
}
}

function sel_status(a,b,c)
{
document.getElementById('display_cats').value=a;
document.getElementById('display_grids').value=b;
document.getElementById('filter').value=c;
document.display_cat.submit();
}

function edit_image(id) {
alert(id)
document.getElementById('sel_cat').value=id;
document.edit_img.submit();
}

function add_image(id) {
//alert(id);
document.getElementById('cat_name').value=id;
document.add_img.submit();
}

/*function edit_image_other(id) {
document.getElementById('sel_cat').value=id;
document.edit_img.submit();
}
*/
function add_image_other(id) { 
alert(id);
document.getElementById('cat_id').value=id;
document.add_img.submit();
}


//function for user info

function userinfo(id) {
document.getElementById('user_id').value=id;
document.user.submit();
}


function publish_single_user(pub_id,pub_val)
{
document.getElementById('pub_user_oth').value=pub_id;
document.getElementById('pub_value_oth').value=pub_val;
document.getElementById('pub_user_val_mul').value='';
document.publish_user.submit();
}

function modify_status_user(chk,a)
{
var str='';
for (i = 0; i < chk.length; i++) {
	if(chk[i].checked == true) 
	{ 
		str =str+chk[i].value+","; 
	}
}
document.getElementById('pub_user_oth').value=str;
document.getElementById('pub_user_val_mul').value=a;
document.publish_user.submit();
}

function sel_status_user(a,c)
{
document.getElementById('display_user').value=a;
document.getElementById('filter').value=c;
document.dis_user.submit();
}
//function for edit image

function change(id) {
document.getElementById('img_cat').value=id;
document.cat_img.submit();
}

function publish_single_img(pub_id,pub_val)
{
document.getElementById('pub_img_oth').value=pub_id;
document.getElementById('pub_value_oth').value=pub_val;
document.getElementById('pub_value_mul').value='';
document.publish_img.submit();
}

function modify_status_img(chk,a)
{
var str='';
for (i = 0; i < chk.length; i++) {
	if(chk[i].checked == true) 
	{ 
		str =str+chk[i].value+","; 
	}
}
document.getElementById('pub_img_oth').value=str;
document.getElementById('pub_value_mul').value=a;
document.publish_img.submit();
}

function sel_status_img(a)
{
document.getElementById('display_img_id').value=a;
document.display_img.submit();
}

function delete_cat_img(chk)
{
var answer=confirm("Do you really want to delete?");
if(answer) {
var str='';
for (i = 0; i < chk.length; i++) {
	if(chk[i].checked == true) 
	{ 
		str =str+chk[i].value+","; 
	}
}
document.getElementById('del_img_id').value=str;
document.del_cat_img.submit();
}
}

//fuction for edit_home_img

function change_home(id) {
document.getElementById('img_cat').value=id;
document.cat_home_img.submit();
}

function publish_home_single_img(pub_id,pub_val)
{
document.getElementById('pub_img_oth').value=pub_id;
document.getElementById('pub_value_oth').value=pub_val;
document.getElementById('pub_value_mul').value='';
document.publish_home_img.submit();
}

function modify_home_status_img(chk,a)
{
var str='';
for (i = 0; i < chk.length; i++) {
	if(chk[i].checked == true) 
	{ 
		str =str+chk[i].value+","; 
	}
}
document.getElementById('pub_img_oth').value=str;
document.getElementById('pub_value_mul').value=a;
document.publish_home_img.submit();
}

function sel_home_status_img(a)
{
document.getElementById('display_home_img_id').value=a;
document.display_home_img.submit();
}

function delete_home_cat_img(chk)
{
var answer=confirm("Do you really want to delete?");
if(answer) {
var str='';
for (i = 0; i < chk.length; i++) {
	if(chk[i].checked == true) 
	{ 
		str =str+chk[i].value+","; 
	}
}
document.getElementById('del_img_id').value=str;
document.del_home_cat_img.submit();
}
}


//function for add_img_gallery

function sel_add_status_img(a)
{
document.getElementById('display_img_id').value=a;
document.display_img_gallery.submit();
}

//function for galler_display
function gallery_edit(id) {
document.getElementById('gal_id').value=id;
document.gallery_id.submit();
}

function modify_gallery_status(chk,a)
{
var str='';
for (i = 0; i < chk.length; i++) {
	if(chk[i].checked == true) 
	{ 
		str =str+chk[i].value+","; 
	}
}
document.getElementById('pub_cat_oth').value=str;
document.getElementById('pub_value_mul').value=a;
document.publish_gallery.submit();
}

function publish_gallery_single(pub_id,pub_val)
{
document.getElementById('pub_cat_oth').value=pub_id;
document.getElementById('pub_value_oth').value=pub_val;
document.getElementById('pub_value_mul').value='';
document.publish_gallery.submit();
}

function delete_gallery(chk)
{
var answer=confirm("Do you really want to delete?");
if(answer) {
var str='';
for (i = 0; i < chk.length; i++) {
	if(chk[i].checked == true) 
	{ 
		str =str+chk[i].value+","; 
	}
}
document.getElementById('del_gal_id').value=str;
document.del_gallery.submit();
}
}

//fuction for edit_gallery
function edit_gallery(id) {
alert(id);
document.getElementById('category_id').value=id;
document.edit_gal_img.submit();
}


//]]-->

